HI,
i am Mehmood khan Computer Science Student from Pakistan and i have a project in client want to made an automate application that when the message from specific number comes to me it transfer that message to my laptop i want to automate this how i acan automate this please help me or i us shell script or python script for it
Notifications
RSS for tagLearn about the technical aspects of notification delivery on device, including notification types, priorities, and notification center management.
Post
Replies
Boosts
Views
Activity
I am using the same ChannelManager, however when switching to another channel, I leave the channel and then requestToJoin a new channel with the new inputted ChannelName and PTDescriptor however the name and image are not changing when I go to background to see the Native UI. Am I missing something to call for an update for the PTDescriptor?
Hi,
My app works correctly in debug with Mac Catalyst and receive push, when I uploaded in TestFlight and installing from TestFlight not receiving any more push but the server of apple respond 200 ok.
we don't use certificate but keyID.
I am trying to refresh my widget through Silent Push Notifications.
I have the background value as well as content-value = 1.
However 99% of the time if the app is in the background or has been fully terminated/exited, the silent push notification won't start the app.
I also tried logging the method that runs when the notification is received and it seems like it only gets called once the app is re-launched manually.
Do I need to do anything to get it to get my widget to refresh when some events happen on the backend? Android is really smooth when it comes to implementing similar logic.
In iOS 17 beta 4, the Live Activity on lock screen is always rendered in dark mode. The issue can be reproduced both on physical device and simulator.
If you update live activity with alertConfiguration: argument, iPhone shows a notification (or expands dynamic island):
await runningActivity.update(content, alertConfiguration: .init(title: "Alert", body: "Done!", sound: .default))
Paired Watch presents a notification as well:
I cannot find a way to dismiss that live activity notification from Watch. Is there a way to remove it similarly to UNUserNotifications?
UNUserNotificationCenter.current().removeDeliveredNotifications(withIdentifiers: [notificationID])
Is it possible to get enabled status of app's live activity through areActivitiesEnabled inside other targets (other than main target)? seems it always returns true.
Our Vendor MDM CSR certificate will expire in a month. We are trying to renew/update it, but we are unsuccessful. We keep getting the message "Certificate signature Verification failed because the signature is invalid." Has anyone dealt with the renewal, or can anyone advise? We do everything according to the Apple documentation, but unfortunately there is not as much about renewal the certificate as there is about initially creating it. Can anyone help? Thank you
There's an issue in the iOS 17 beta where passing nil to activityBackgroundTint(_:) does not use the system's default background material as expected. Instead, it's showing a solid black color instead of the correct tint that matches the rest of the system in iOS 16.
I have enabled developer mode in flutter app development.
I am using Firebase Cloud Messaging to send notifications.
everything works fine There is a notification coming to the normal app.
But after a while I can no longer send notifications to the app.
{"multicast_id":5417898622260949101,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]}
The fcm device token doesn't seem to work.
This caused me to request a new fcm device token.
and after using it for a while, it came back like the first time
Is this caused by the APN token being canceled?
or caused by enabling developer mode to develop apps.
As Swift give as async await functions, I tried to use them for push notifications. In my case if I use
extension TMNotificationCenter: UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
completionHandler([.sound, .banner, .list, .badge])
}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
completionHandler()
}
}
There are no error, erevything works fine, but when I change to this:
extension TMNotificationCenter: UNUserNotificationCenterDelegate {
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions {
print(#function)
return [.sound, .banner, .list, .badge]
}
func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async {
print(#function)
}
}
I got crash:
What I am doing wrong?
Hello everyone
Our application started to spam the Firebase Push Notifications when the device had the iOS 17 Beta. This behavior does not happen in iOS 16, but it was reproduced in many iOS 17 Beta (Beta 3, 4 & 5).
The issue goes like this:
Our backend service uses an SDK Firebase to send one notification
The user receives the notification
Then after some minutes, the device starts to receive the same push notification with the old date-time, by intervals of 5 to 15 minutes
We also got reports of other people with the same issue:
https://stackoverflow.com/questions/76620368/spam-of-fcm-push-notifications-on-ios-17-beta
https://github.com/kreait/firebase-php/issues/814
You can see the following screenshot of the output of this after 2 hours:
You have already reached the maximum allowed number of Keys for this service.
How do I fix this?
If I schedule for example three local notifications and attach three different copies of the same image (copies are done before scheduling). Then if user in the notification center selects "Clear" on the first notification, then the next two notifications will be missing the attached image (although it was handed different copies of the same image).
I already know that when scheduling a local notification with an image, iOS will either copy or move the supplied image (depending on file location) to some temp storage it uses for local notifications. So I make sure to first take individual copies of the image and then hand them to the local notification.
I did find an ugly workaround to this problem that works. That for each copy of the image I slightly modify the image size and jpg compression of that identical image, then it doesn't happen.
It's like iOS image duplicate detection logic is activated for local notifications, and I'm fighting some "hash", business-logic or machine learning evaluation if the images are duplicates and should be removed for all attachments when clearing notification (or the folder of the attachments). Which seems wrong.
Bonus info: I even tried that if I only changed jpeg compression slightly on a small picture (200x200) then it could still happen, but if I then at the same time changed the image size by 1 pixel it would be fine. I also tired changing the same small image by 1pixel without compression then the problem happened.. So it feels like it's not a hash of the image (like MD5) but rather some logic or machine learning evaluation.
I have on my to-do to try a one color image to see if that triggers the problem no matter size and compression, just for my curiosity.
Experienced on iOS 15.6+ and 16+
I recently began work on an app that uses push notifications and the app already has a version in the store. I no longer have access to the original development and distribution certificates. I know I need to generate new certs. However, will the new certificates work with the existing APN key, or will I have to generate a new APN key as well? Any links or info will help. Thanks.
Clevertap issuing a notice that iOS push certificate has expired 1 day(s) ago. Upload a new one. But the original APNs are still going on and cannot download more than two. Also don't have any old certificates with me.
I had called "registerforremotenotifications", but "didRegisterForRemoteNotificationsWithDeviceToken" and "didFailToRegisterForRemoteNotificationsWithError" not been callback, so that I should not get DeviceToken. Credentials, Compile options and so on, I had check all of them.
what's the reason? Networking or APNs overload?and other?
Please help to check.
I am trying to write some code to send a push notification to a pass on an Apple device using C# .NET and HttpClient over HTTP2 with client certificate authentication.
When I run the code, I am seeing the below exception:
InnerException = {"Error 12152 calling WinHttpWriteData, 'The server returned an invalid or unrecognized response'."}
I am trying to find out why this code is failing?
Is it possible to debug/troubleshoot this in some way?
Running this code on Windows 10 OS Build version: 21H2 (19044). The application is built on .Net Framework 4.8 and tried using WinHttpHanlder versions 6 and also 7.
Also, tried using other third party open source libraries like PushSharp and DotApns. PushSharp does not seem to support Http/2 and dotApns does not support certificate authentication for .net framework. We have no plans to migrate to .net Core.
Below is my code:
private static string pushToken = "dbc56849<hidden>";
private static string AppleApnServer = "https://api.sandbox.push.apple.com";
public static async Task<PushResult> SendPushNotificationToWalletPass(string notificationContent)
{
byte[] certificateData = LoadCertificate();
X509Certificate2 certificate = new X509Certificate2(certificateData, String.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
string url = $"{AppleApnServer}:443/3/device/{pushToken}";
StringBuilder payload = new StringBuilder();
payload.Append("{ \"aps\" : ");
if (string.IsNullOrWhiteSpace(notificationContent))
{
payload.Append("\"\" }");
}
else
{
payload.Append(notificationContent);
payload.Append(" }"); // close aps dictionary
}
var handler = new Http2Handler();
handler.ClientCertificates.Add(certificate);
using (var httpClient = new HttpClient(handler))
{
using (var request = new HttpRequestMessage(HttpMethod.Post, url))
{
var messageGuid = Guid.NewGuid().ToString();
request.Content = new StringContent(payload.ToString());
request.Headers.Add("apns-id", messageGuid);
request.Headers.Add("apns-push-type", "alert");
using (var response = await httpClient.SendAsync(request, HttpCompletionOption.ResponseHeadersRead))
{
HttpStatusCode statusCode = response.StatusCode;
string reasonPhrase = response.ReasonPhrase;
bool success = response.IsSuccessStatusCode;
Console.WriteLine($"APN {(success ? "Delivered Successfully!" : $"Failed to Send! :: StatusCode [{statusCode}] Reason [{reasonPhrase}]")} :: PushToken [{pushToken}]");
if (!success)
{
switch (statusCode)
{
case HttpStatusCode.Gone:
// The device token is no longer active for the topic.
return PushResult.DeviceNotRegistered;
default:
return PushResult.Failure;
}
}
return PushResult.Success;
}
}
}
}
public enum PushResult
{
Success = 0,
Failure = 100,
DeviceNotRegistered = 200
}
// Apple APNS requires http2 but .Net Framework does not support http2 (only built in support in .net core)
// found this workaround https://stackoverflow.com/questions/32685151/how-to-make-the-net-httpclient-use-http-2-0/43101990#43101990
private class Http2Handler : WinHttpHandler
{
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
{
request.Version = new Version("2.0");
return base.SendAsync(request, cancellationToken);
}
}
I'm developing a Flutter application that utilizes topic messaging to send notifications to iOS devices using Firebase Cloud Messaging (FCM). I've followed the FCM documentation to initialize the topic and set up an API for sending messages. The API is triggered every hour through a cron job on the server. When a topic message is received, the app displays a notification and performs some background processing. While the notification is successfully delivered when the app is in the background, I'm encountering inconsistent behavior when the app is in a killed state.
What I've Tried: I've double-checked the implementation of the FCM topic initialization and the message sending API, and everything appears to be correct. I've also verified that the cron job on the server is running as intended and the API calls are being made regularly. The issue seems to be related to how the app behaves when it's not running in the background.
Topic Initialisation:
if (!Platform.isAndroid) {
await FirebaseMessaging.instance.subscribeToTopic("ios-scheduling");
}
API for delivering topic message:
router.post('/', (req, res) => {
const topic = "ios-scheduling";
const body = req.body;
console.log("Request Body", req.body);
const message = {
notification: {
title: "OsuniO",
body: "You may have some pending tasks.",
},
data: {
"notificationType": body['notificationType']
},
apns: {
payload: {
aps: {
contentAvailable: true,
"interruption-level": "time-sensitive"
}
},
headers: {
"apns-push-type": "background",
"apns-priority": "5",
"apns-topic": "io.flutter.plugins.firebase.messaging"
}
},
topic: topic
};
console.log("message to be sent to the user: ", message);
admin.messaging().send(message)
.then((response) => {
// Response is a message ID string.
console.log('Successfully sent message:', response);
res.status(200).json(message);
})
.catch((error) => {
console.log('Error sending message:', error);
res.status(400).json({
message: error
}).end();
});
});
module.exports = router;
Expected Behavior: I expect that when a topic message is sent via FCM, regardless of whether the Flutter application is in the foreground, background, or killed state, the notification should be reliably displayed on the device. Additionally, the associated API should be triggered consistently to perform the required background processing.
I'm working on an iOS app and I'm trying to implement notification filtering using the com.apple.developer.usernotifications.filtering entitlement. I want my app to receive only specific remote notifications based on certain criteria. However, I'm having trouble getting this entitlement to work as expected. Can you provide a step-by-step guide on how to correctly use the com.apple.developer.usernotifications.filtering entitlement for notification filtering? What are the key points and considerations I should keep in mind?
Where should I add the com.apple.developer.usernotifications.filtering entitlement? Should it be added to the main app target or an app extension?
Could you provide an example of how the entitlement key-value pairs should be structured for filtering notifications? For instance, if I want to filter notifications with a specific title and subtitle, how should I format this in the entitlements file?
How can I ensure that my entitlements file is correctly referenced in my app's target settings? Are there any specific configurations I need to be aware of?
I appreciate your assistance in helping me understand how to effectively use the com.apple.developer.usernotifications.filtering entitlement for notification filtering in my iOS app. Thank you!
Regenerate