Notifications

RSS for tag

Learn about the technical aspects of notification delivery on device, including notification types, priorities, and notification center management.

Notifications Documentation

Post

Replies

Boosts

Views

Activity

Send ImagePreview within firebase cloud messaging to iOS
Is there a way to to add a key for imageURL below that shows as image preview on the right side of a push notification or do i need to create a Notification Content Extension to make it work? `const message = { apns: { payload: { aps: { 'mutable-content': 1, alert: { title: title, body: body, image: imageURL, }, }, }, fcm_options: { image: imageURL, }, }, data: { articleId: articleId, 'media-url': imageURL, }, tokens: tokens, };` I'm getting the image through, but just if the user long presses on the push notification and then it appears below, but i want it to look like in the screenshot: Thanks
3
0
195
Oct ’24
Not getting push after installing a test version
Hi After uploading a problematic version of our app to TestFlight my iphone does not get push notification anymore for our app. Other users are not affected. I deleted the app and installed the version from the appstore and still i do not get push notifications to the app. anyone that installed the version on testflight can't get push notification even if they went back to the original version from the app store. also tried to shutdown / startup the phone... no change. Any idea what went wrong and how to fix it?
3
0
220
Oct ’24
Notification not delivered to offline device getting back online
Hi there, I observed situations where a notification won't get delivered to an iPhone that is offline at the moment the notification request is made to the APNs, and gets back online a few hours later. It does not appear to be a fully repeatable issue, but it does happen much more than sporadically. I know the storage of notification by APNs is provided as a best-effort service and is not guaranteed, but I do believe there is an issue that maybe is worth looking at. I controlled for all aspects that could explain the issue: APNs return a success code on the request the apns-expiration timestamp is not reached when the device gets back online apns-priority is set to 10 target device was in charge while offline no other notification were sent for the device I provided detailed logs in feedback FB15381079 Also sharing a remark on this piece of the APNs documentation: "When you send multiple notifications to the same device for a bundle ID, APNs selects only one notification to store in a non-deterministic way." It would be very useful to confirm whether silent push notification may lead APNs storage to dismissed an alert notification in favor of the silent push. Thank you
1
0
155
Oct ’24
Best way to wake app to sync data
If I have data on server that is updated periodically (e.g., daily or weekly), and I want to have that data sync'd to iOS app, what is best way? I want to make sure it will get updated when app is in foreground, background, swiped away (terminated), or following a phone restart. The two ways I'm thinking of are PushKit and User Notifications. I'm currently using User Notifications, but I am finding that sometimes the notification doesn't get processed (haven't yet determined reliable conditions for duplicating this problem). I'm mainly wondering if, given the use case (occasional updates that ideally are processed in background ASAP), this is the best approach.
3
0
175
Oct ’24
Generating and receiving token for Push Notifications stopped working
Hi, hope you're all doing well. I have a real brain-cracker here... Have been looking into this for the past 20 hours, but can't figure it out. We built an iPhone app that essentially functions as a shell around a PWA Web-App using WebView. The tricky part here to set things up was getting the Push Notifications to work. Eventually we got this working though (with help of Firebase), and the app has been working great for the past 7 months. Now, all of a sudden as it seems, when users first open up the app, there's no FCM token generated and passed on to the WebView instance running javascript. Or at least, the listening event ('push-token') no longer gets fired. Users who already have their FCM token generated and stored earlier on, receive push notifications without any issues. It's just that no new FCM tokens seem to be generated - or at least no longer passed to the WebView's javascript code. I know this for a fact as my tests turn out that the following event (present in my PWA Web-App JS code) no longer gets fired. Again, this worked fine before. I have NOT updated the native app since 6-7 months. `/* LISTEN FOR FCM (PUSH MESSAGES) TOKEN FROM NATIVE (IOS) SHELL: */ window.addEventListener('push-token', function(event) { //alert("Push Token registration event called from native shell"); if (event && event.detail) { var token = event.detail; window.fcmPushMessageToken = token; localStorage.setItem('fcmPushMessageToken', token); //alert("Received FCM token: " + token); registerDeviceForPushMessages(); } });` Hereé the part in my native iOS code that used to call this event from within the native iOS shell: func handleFCMToken(){ DispatchQueue.main.async(execute: { Messaging.messaging().token { token, error in if let error = error { print("Error fetching FCM registration token: \(error)") checkViewAndEvaluate(event: "push-token", detail: "ERROR GET TOKEN") } else if let token = token { print("FCM registration token: \(token)") checkViewAndEvaluate(event: "push-token", detail: "'\(token)'") } } }) } func checkViewAndEvaluate(event: String, detail: String) { if (!EPDriversApp2.WebView.isHidden && !EPDriversApp2.WebView.isLoading ) { DispatchQueue.main.async(execute: { EPDriversApp2.WebView.evaluateJavaScript("this.dispatchEvent(new CustomEvent('\(event)', { detail: \(detail) }))") }) } else { DispatchQueue.main.asyncAfter(deadline: .now() + 1.0) { checkViewAndEvaluate(event: event, detail: detail) } } } Again, I have not updated the native iOS app OR the WebApp's code. This just stopped functioning all of a sudden. One "weird" thing I noticed that there's no Provisiong Profile associated with the app. I'm not sure whether this was ever the case before, to be honest. Is this even mandatory? Can not having a Provisiong Profile associated with the app effect the ability of an already pusblished app for generating Push Notification tokens?
0
0
200
Oct ’24
WatchOS local notifications delayed
I'm scheduling local notifications on my WatchOS app, but they are always alerting exactly 13 seconds later than scheduled. I have read other users having the exact same issue but there is no solution anywhere. I'm not sure how one is supposed to write any sort of timer app when they are always coming in delayed. Any idea why this occurs and how to resolve it? For now I am subtracting 13 seconds from the end time, but that's not really a solution I'm happy with. Thanks
2
0
268
Oct ’24
Local notification shown in iphone not shown on apple watch
I created a local notification as follows: func scheduleNotification(title: String, subtitle: String = "", date: Date, id: String) { // Extract the components from the date let calendar = Calendar.current let hour = calendar.component(.hour, from: date) let minute = calendar.component(.minute, from: date) let second = calendar.component(.second, from: date) // Set the extracted components into DateComponents var dateComponents = DateComponents() dateComponents.hour = hour dateComponents.minute = minute dateComponents.second = second let content = UNMutableNotificationContent() content.title = title content.subtitle = subtitle content.sound = UNNotificationSound.default let action1 = UNNotificationAction(identifier: Constants.NOTIFICATION_ACTION_IDENTIFIER_1.id, title: Constants.NOTIFICATION_ACTION_IDENTIFIER_1.label, options: []) let action2 = UNNotificationAction(identifier: Constants.NOTIFICATION_ACTION_IDENTIFIER_2.id, title: Constants.NOTIFICATION_ACTION_IDENTIFIER_2.label, options: []) let category = UNNotificationCategory(identifier: "reminderCategory", actions: [action1, action2], intentIdentifiers: [], options: []) UNUserNotificationCenter.current().setNotificationCategories([category]) content.categoryIdentifier = "reminderCategory" let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false) let request = UNNotificationRequest(identifier: id, content: content, trigger: trigger) // add our notification request UNUserNotificationCenter.current().add(request) } and I also have func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { // Handle foreground presentation options completionHandler([.sound, .badge]) } but for some reason the notification only shown on the phone. I've made sure that the phone is locked, apple watch is unlocked and also the notification setting in the watch app for this app is set to mirror.
0
0
194
Oct ’24
What is migration process or steps needs to be taken from App side while migrating the push notifications approach from certificate to keys(token)
We are recently started the migration from Certificate based approach push notification configuration to Token bases (APNS Keys) approach push notifications. From Server side, its pretty straight forward that we need to use APNS Keys. But We are facing one issue where we are not sure whether we can expire the existing push notification certificate that we are using so far or not. If I expire the existing certificate, then it will also be removed from App Id configuration capabilities as shown below and when I create the provisioning profile for this Bundle Id, it doesn't contain the push notification capability and also shows error in the Xcode while using the profile. can anyone help on this how to resolve this issue ? or any process or steps to follow for this migration ? Thanks in advance.
2
0
232
Oct ’24
Push notifications functions never triggered
I've spent over a day on this so I'm hoping someone on here has some idea as to what is going on for me. I've implemented push notifications in my app, but when I send a notification to a device, none of the receiving function are triggered. When the app is in the background, the notification arrives correctly, and when tapped it correctly launches the app - but the didReceiveRemoteNotification function is never triggered, so I'm unable to handle/react to the notification. When the app is in the foreground, neither the willLaunch or didReceive functions are triggered. I'm setting the UNUserNotificationCenterDelegate in the willFinishLaunchingWithOptions function, and when I monitor the app via the console, it shows no errors and shows willPresentNotification delivery succeeded I have updated the Background Modes to include background fetch, background processing, and remote notifications. I have also tested this on both the Xcode simulator and a physical device with the same results. I've also tested this with push notifications coming from my server, push notifications coming from the CloudKit console, and just dropping a JSON file onto the simulator. All resulted in the same behaviour. Does anyone have any idea why these functions might not be triggered??
3
0
214
Oct ’24
Push notification tracking
Subject: Seeking Native iOS Solution for Push Notification Acknowledgement and User Interaction Tracking I’m exploring whether there is a native solution in iOS to track the confirmation/acknowledgement of a received push notification on the device, as well as any user interaction with it (e.g., tapping or dismissing the notification). Although I’ve come across multiple discussions on this topic suggesting that it’s not possible, I’d like to know if there have been any recent updates or enhancements in iOS that provide this capability. Has anyone found a reliable approach or workaround for this? Any insights would be appreciated! Thanks!
1
0
218
Oct ’24
UNNotificationRequest Scheduling Limitation
I have read from previous posts in the forum and in StackOverflow that the limitation of 64 notification is still present with the current iOS18 version right? Inside testflight I was not able to reproduce this limit and was wondering if it only applies to the AppStore. Is it only a limit of scheduled notifications or is there also a limit of delivered notifications ? I find the Apple documentation lacking detail in this regard. If the latter is the case, I will not bother building a notification manager to deal with frequent notification scheduling. thank you in advance S.
2
0
170
Oct ’24
Iphone 12 Mini - Bluetooth Problem - IOS 18
I have been experiencing a consistent problem when connecting to a bluetooth device (Speaker, Vehicle, Etc.) where the music cuts-out every time I receive a notification or my Iphone screen turns on or off. This never happened before the update. I have tried restarting, downgrading to previous IOS versions and reupdating to the latest. No luck, unfortunately. I thought this might be due to the devices, but this happens when playing music through my device as well. I have checked the notification settings and haven't found anything that fixes this problem. Any assistance would be much appreciated.
1
0
168
Oct ’24
Screen stays on after notification iOS 18 - 16 pro max
after my phone receives a notification, the screen stays on. i Waited 15 minutes and did not go off (fully lid) battery drained 5%. Always on display was set to OFF. Restarting the phone solved the issue, but home & loch screen has been my No..1 battery use since I have the iPhone 16 (2 weeks). never saw that app using battery in the previous 10 year of iPhone use. My new iphone 16 pro max does not appear to have much more battery life than my previous 12 pro max with battery cap at 83%
1
0
342
Oct ’24
Obtaining LiveActivities pushToStart token
I want to add Live Activities to my e-commerce app to show the estimated delivery ETA when an order is out for delivery, with the Live Activity initiated from the server. Issue 1: How can I consistently obtain a pushToStart token when a user logs in to my e-commerce app? Currently, I’m considering starting and ending a dummy Live Activity to retrieve the token. Is there a better way to trigger pushToStartTokenUpdates and send the token to my server? Issue 2: How do I properly invalidate the pushToStart token when a user logs out, ensuring the next user doesn’t inherit the same token? Ideally, I don't want the user to wait until the token is automatically invalidated before logging out.
2
0
229
Oct ’24
WKApplication.didBecomeActiveNotification not fired when Control Center (or other system overlay view) dismissed by system
https://forums.developer.apple.com/forums/thread/685317 Having read the above discussion, I can add there’s one problematic exception on watchOS to the rule that .didBecomeActiveNotification is fired when the Control Center or any other overlay (such as a long-look notification) is dismissed. It’s when it’s dismissed not by the user, but just allowed to dsimiss itself after a period (as determined by Settings > Wake Duration). This is a problem for any Watch workout app because when one of these overlays is covering the app, it’s considered by the system to be backgounded for purposes of applying the 15% avg CPU load over 60 seconds criteria for being terminated for using too much CPU in the background, so I have discovered. In the case of these overlays covering an app, the app never gets a .didEnterBackgroundNotification call to know that it should attempt to reduce its activity, when the user presses the Side Button to show the Control Center, which is by design, as I understand it. The app does get a .willResignActiveNotification when the Control Center covers it, but there is no corresponding .didBecomeActiveNotification when the system dismisses the Control Center after 2 minutes or so. So if the app reduces its actvity in an attempt to reduce CPU load when covered by the Control Center overlay, it has no way to know it has become active again, in the special case of the Control Center timing out and being dismissed by the system. What could be done to reduce the likelihood of the system terminating the app in this situation, and maintain the app's functionality and usability?
2
0
285
Sep ’24
Delayed App Store Server Notification(V2) for Subscription Purchase
We experienced an issue with delayed App Store Server notifications for an Auto-Renewable Subscription purchase in our app. On September 27, 2024, at 22:28:28 GMT+0900, a user successfully purchased a Premium membership subscription (transaction ID: 190002223966278, webOrderLineItemId: 190001007274949). However, our server did not receive the corresponding App Store notification for this transaction after purchase. The App Store Server Notification was only received 66 minutes later, at 23:35:16 (transaction ID: 190002224000004, webOrderLineItemId: 190001007274949). The delayed notification contained a different transaction ID than the initial purchase. We would like to inquire about the cause of this delay and request assistance in understanding why the notification took 66 minutes to be delivered to our server, instead of arriving immediately after the transaction was completed. Additionally, we would appreciate your guidance on how to prevent or mitigate such delays in the future, ensuring a seamless experience for our users. Are there any best practices or recommended approaches we should implement to handle potential notification delays more effectively? We have provided detailed information about the received notification and the related transactions in the Feedback Assistant (FB15330451). Thank you for your assistance in resolving this matter. Key Details Purchase time: 2024-09-27T22:28:28 GMT+0900 (1727443708000) Notification received: 2024-09-27T23:35:16 GMT+0900 (1727447716463) Delay: 66 minutes and 48 seconds Initial Purchase Transaction ID: 190002223966278 Initial Purchase Web Order Line Item ID: 190001007274949 Transaction ID in Delayed Notification: 190002224000004 Web Order Line Item ID in Delayed Notification: 190001007274949 Additional info Bundle ID: com.reppley.ReppleyApp SKU: com.reppley.ReppleyApp Feedback Assistant Number: FB15330451
1
0
324
Sep ’24
unable to see apple ai responses as they are always blurred out
i’m on an iphone 15 pro max 18.1 beta. I have apple ai and no matter what i ask it i am unable to see the apple ai response as it is always blurred out? if i click copy and paste into a text or notepad the answer shows up so the ai is working and answering my commands it just doesnt show on the screen… if i put that i want the answers read to me it’ll read it but the response will still be blurred ? please someone help
0
0
177
Sep ’24
ANCS
After a prolonged BLE connection, we have noticed that ANCS frequently pushes a large number of "remove" messages (event ID 0x02), after which the device no longer receives any notifications. Is this behavior a result of system design, or could it be a potential bug? I would appreciate any insights or experiences that others can share.
2
0
149
Sep ’24
What restrictions does didReceiveRemoteNotification have when the app is started in background by the system?
I previously posted a topic about receiving application(_:didReceiveRemoteNotification:fetchCompletionHandler:) callback when my app is not running, and the system starts the app in the background to respond to a notification. While I receive the callback reliably, the work performed by the callback seems to have different restrictions whether the app is in the background or not running. When the app is running in the background, the work started in this callback completes reliably (in my case it takes no more than a few seconds), and I can post the result back to the system via the completion handler. When the app is not running and the system starts it in the background, the app starts the same work, but this work seems to be terminated quickly without being able to complete, and without me being able to call the completion handler passed to the callback. I’m not talking about 30 seconds - the termination seems to happen after less than a second, which is not enough for my app. The nature of the work shouldn’t matter, but just in case: I start a Task in the callback for some asynchronous work, which stores the completion handler, and calls back to it when the work is finished. This happens completely reliably when the app is running in the background, and not at all reliably when the app is not running and is started by the system. Why would application(_:didReceiveRemoteNotification:fetchCompletionHandler:) behave differently based on if it is ran when the app is already running, vs not running and started by the system? Is there anything I can do on my side to make it more reliable?
2
0
337
Sep ’24