Send push notifications to Mac, iOS, iPadOS, tvOS devices through your app using the Apple Push Notifications service (APNs).

APNS Documentation

Pinned Posts

Posts under APNS tag

254 Posts
Sort by:
Post not yet marked as solved
0 Replies
256 Views
I am checking the Push Notification Console of Cloudkit to understand my apps push delivery metrics. There are nice metrics in there to see push sends and discards. But I couldn't see any metric to understand "How many of the users opened the notiifications I send". Is there any way me to understand this statistic? Also can we export this metrics without logging in to CloudKit like an API request?
Posted
by emindeniz.
Last updated
.
Post not yet marked as solved
1 Replies
279 Views
I have multiple mobile applications, one developed in React Native and the other in Objective-C and Swift hybrid technology. I use my own system to send push notifications, and these notifications are left encrypted in the Apple queues. However, in any of my applications, I am unable to catch these messages in the code block where I decrypt them. As a result, users see the messages encrypted. While I can deterministically detect this issue on devices experiencing the offload feature from Apple, I've also noticed sporadic occurrences of this issue on devices not utilizing offload. Due to my security policies, I have no chance of sending messages unencrypted. I'm trying to understand why this is happening and need suggestions for a solution. Is there anyone who can help? Additional Information: I use my own system for push notifications. Messages are left encrypted in the Apple queues. I am unable to catch the messages in the code block where I decrypt them in one of the applications. I can deterministically detect the issue on devices experiencing the offload feature. I've noticed sporadic occurrences of this issue on devices not using offload. Due to security policies, I have no chance of sending messages unencrypted. I tried sending without offloading, and the messages arrived unencrypted I searched for a callback handler function on the Apple side - couldn't find one. To ensure notifications were sent correctly, I performed token checks in my database.
Posted Last updated
.
Post not yet marked as solved
1 Replies
251 Views
Hi! I have recently added the functionality of notifications in my app. I can send notifications and I see them in my phone well. The problem is that even if I have no notifications, the badge shows I have 3 and I can not remove this notification when I read the notifications. What it is strange is that even if I send new notifications, the number 3 is still there...
Posted Last updated
.
Post not yet marked as solved
0 Replies
252 Views
I have a shopping list app that shares a list of Product records between users. The app on my phone shared its private database with another user account (running on a simulator) which accepted it. Both devices can see changes from the other if the device does a full refresh from iCloud. Now I want to have the app on the devices be notified when the other changes/adds/deletes a Product record. I did the following to get push notifications to work (but haven't been successful yet) I have enabled background fetch and remote notifications in my app capabilities. The app registers for remote notifications with UIApplication.shared.registerForRemoteNotifications() and receives the didRegisterForRemoteNotificationsWithDeviceToken callback. The app sets a subscription with CKModifySubscriptionsOperation for the "Product" recordType. I set the QoS to .utility on the appropriate private or shared database. However, when I add a Product record on my record, the didReceiveRemoteNotification callback doesn't execute. What am I missing?
Posted
by bobku.
Last updated
.
Post marked as solved
1 Replies
321 Views
Hi, I need a feature in the iOS app that requires updating the user screen via FCM. In other words, I have to update it with no sound and screen display, but this doesn't work. When I remove the notification field, the notification will not be displayed to the user, but the sound will be played. If I remove the sound field, I can make no sound, but the user will be notified. If I remove both, I'm not getting this from the iOS app. How can I solve this?? Which option should I send Push from the server?? I'm also using Notification Service Extension.
Posted
by kimjitae.
Last updated
.
Post not yet marked as solved
0 Replies
446 Views
Prior to .p8 tokens, we were using .p12 cert for communication with APNS. We have since migrated to use .p8 token within our 3rd party push notification provider however, we still have the .p12 cert associated with our AppStore provisioning profile. Do we still need to maintain the .p12 cert to ensure the validity of the AppStore provisioning profile? Will revoking the .p12 cert result in inability for Apple to recognize that the app has push notifications enabled?
Posted
by tjait05.
Last updated
.
Post not yet marked as solved
0 Replies
298 Views
In Flutter application, Is there FCM related any changes for new iOS versions? I didn't find any solution regarding this. Working fine in android all versions and in iOS working fine till version 16. Also verified from app setting (version 17 and above), Notification permissions enabled. Also get success from this API - https://fcm.googleapis.com/fcm/send response - "multicast_id": 912044660XXXXXX, "success": 1, "failure": 0, But not receiving any message, tried with debug and console log but there is no message/log or error message.
Posted Last updated
.
Post not yet marked as solved
0 Replies
369 Views
We are enrolled in the Apple Developer Program as an organization but still, I don't see any options to create an MDM certificate in the certification section. Kindly guide us the steps and options to enable the same.
Posted
by WitsLab.
Last updated
.
Post not yet marked as solved
1 Replies
373 Views
One Line Summary window.safari.pushNotification.requestPermission() is no longer showing a prompt to the user with Safari 17.3 on macOS 14.3 and it's callback fires as "denied". Why this is is important to fix Starting with Safari 16 for macOS 13 Apple introduced support for the standard Push API. However it is expected that the original Safari JS API window.safari.pushNotification should continue working, as many sites have not fully upgraded to the new API and Apple has not announced a deprecation. Environments NOT Working macOS 14.3 with Safari Version 17.3 (19617.2.4.11.8) macOS 14.4 Beta (23E5191e) with Safari Version 17.4 (19618.1.13.11.5) Working macOS 13.6.4 with Safari Version 17.3 (18617.2.4.11.11, 18617) MRE (minimal reproducible example) See the following site to quickly reproduce the issue noted here: https://public-mre-macos-window-safari-prompt-bug.glitch.me/
Posted Last updated
.
Post not yet marked as solved
1 Replies
293 Views
This question is a follow-on and clarification from this earlier post. I'd just like to confirm that after an App Transfer has been completed, whether there is any need for a new release to be cut? Judging from the prior post, my understanding is that a new release would not be necessary, and that all the existing versions of the app will continue to connect successfully with the APN servers. The only necessary update would be the server connection between the APN servers and the server used to generate notifications, with a new token or certificate. Is my understanding correct?
Posted Last updated
.
Post not yet marked as solved
3 Replies
504 Views
Hi, I have a UNNotificationServiceExtension, which was running perfectly fine for more than a year. Last week, it has suddenly stopped working, with no apparent changes to the server-side application sending the notification to APNS. The strange part is that it works on some devices and it doesn't work on others. I have confirmed that notifications are enabled for the app in iOS system preferences. com.company.product is the bundle identifier of the main app com.company.product.yyyyy is the bundle identifies of the NSE appname.app and nse.appex are the placeholders for the name of the app and name of the NSE respectively Following is the NSE info.plist: <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>CFBundleDisplayName</key> <string>yyyy</string> <key>CFBundleName</key> <string>yyyy</string> <key>CFBundleIdentifier</key> <string>com.company.product.yyyy</string> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleInfoDictionaryVersion</key> <string>6.0</string> <key>CFBundlePackageType</key> <string>XPC!</string> <key>CFBundleShortVersionString</key> <string>y.y.y</string> <key>MinimumOSVersion</key> <string>13.0</string> <key>NSExtension</key> <dict> <key>NSExtensionPointIdentifier</key> <string>com.apple.usernotifications.service</string> <key>NSExtensionPrincipalClass</key> <string>NotificationService</string> </dict> <key>CFBundleVersion</key> <string>yyy</string> </dict> </plist> Model: iPhone 15 Pro Max iOS Version: 17.3
Posted
by mvohra708.
Last updated
.
Post not yet marked as solved
1 Replies
392 Views
We have noticed that the notification service extension stops working after app update for some users and it only starts working again after rebooting the device. Does anybody else have similar problem and what was the solution?
Posted
by mahdi_qw.
Last updated
.
Post not yet marked as solved
0 Replies
369 Views
I'm observing a sporadic bug in our web client where incoming URLs (triggered by a Push Notification or link tapped in another app) do not trigger either of the two expected API callbacks noted in the developer documentation for UISceneDelegate. Specifically, Apple's docs say: If your app has opted into Scenes, and your app isn’t running, the system delivers the URL to the scene(_:willConnectTo:options:) delegate method after launch, and to scene(_:openURLContexts:) when your app opens a URL while running or suspended in memory. Our client app has opted into scenes and the two callbacks mentioned above work reliably most of the time for incoming URLs. However, using the exact same test links or push notifications, I'm able to reproduce intermittent issues where I can see that neither of the above callbacks are triggered when the app is foregrounded to handle a URL. The bug seems to occur when: The app has been previously launched, and is backgrounded It's left in the background for some time (system memory pressure, from using other apps etc., might possibly play a factor also) In this scenario, sometimes when either an external link or URL via push notification is opened, I can see that neither of the two iOS delegate methods for UISceneDelegate are called. Our app is brought to the foreground correctly as though the URL will be handled, but the URL/link is not processed since it is never sent to our client. A few other notes: When the bug is repro'd using push notifications, I can see that our app receives a callback to userNotificationCenter:didReceive:, so the push notification definitely arrives. However, as noted above, the normal 2 API callbacks for UISceneDelegate are never triggered, and since those two callsites are where we handle incoming URLs, the URL from the push notification is never opened I haven't been able to observe any code in our app that precedes these hooks in our scene delegate that could be interfering. (As mentioned above, the same steps to replicate work the majority of the time) Does anyone know whether this could be a possible iOS bug? Any help/suggestions are greatly appreciated. Thank you
Posted
by mreagan.
Last updated
.
Post not yet marked as solved
0 Replies
229 Views
In my app code I used TARGET_OS_IPHONE/TARGET_OS_IOS for SDK 15 and 16. After go on SDK 17.x these macros are not defined. In my investigation, I found that in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/TargetConditionals.h __is_target_environment(macabi) return false hence the issue. Could you please verify and explain, if I do not understand / use correctly. Regards, Alexei
Posted Last updated
.
Post marked as solved
3 Replies
573 Views
Refer to the document: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/handling_notification_responses_from_apns#3394529 Error code 410, 'Unregistered' means: The device token is inactive for the specified topic. But since February 1st, 2024, we did not got 'Unregistered' response any more. Do you know why ?
Posted Last updated
.
Post not yet marked as solved
0 Replies
361 Views
I'm experiencing an issue while attempting to create a provisioning profile for push notifications. But I can clearly see that the push notification service is enabled for the new provisioning profile. However it still shows error.
Posted
by Vijay_17.
Last updated
.
Post not yet marked as solved
0 Replies
260 Views
Since upgrading to iOS 17.2.1 some app notifications have been duplicated 6 times. Tried turning off the notification then restarting the device & finally turning the notifications back on for the apps but still no luck. The notifications are the same and show up at the same time. Is anyone else experiencing this?
Posted
by sriiOS.
Last updated
.
Post marked as solved
1 Replies
347 Views
How do you wake up an app without using push notification? I am developing a medical app which is isolated from the internet for cybersecurity/HIPAA reasons. When the iPhone is locked, I would like the app to launch, or return to the foreground, when the server notifies it that an event occurred. Is there a way implement this using Swift?
Posted
by NkMA.
Last updated
.
Post marked as solved
1 Replies
271 Views
I want to understand if my Remote notification will be throttled based on the payload that I am sending from my backend. The confusion is due to the introduction of apns-alert-type key with possible values of alert and background. I want to understand if I set the value of apns-alert-type to alert but include the content-available key in the aps dictionary, will such notifications be throttled if sent at a more than recommended frequency of two or three per hour? I have documented by understand here in this sheet: https://docs.google.com/spreadsheets/d/13RU0tS9w4OsPpFjqPeoM0DNm045_5CF9DDdhIM9jarQ/edit?usp=sharing Also adding the same here for easy reference: Case No. apns-push-type apns-priority aps.content-available aps.alert/badge/sound My understanding Observation Notification displayed? App woken up? 1 background 5 0 absent Misconfiguration: content-available should not be 0. ❌ ❌ 2 background 5 0 present Misconfiguration: content-available should not be 0. alert/badge/sound is not alllowed. ❌ ❌ 3 background 5 1 absent Correct Configuration: This is a background notification. ❌ ✅ 4 background 5 1 present Misconfiguration: alert/sound/badge is not allowed. ❌ ✅ 5 background 10 0 absent Misconfiguration:priority 10 is not allowed. content-available should not be 0. ❌ ❌ 6 background 10 0 present Misconfiguration:priority 10 is not allowed. content-available should not be 0. alert/sound/badge is not allowed. ❌ ❌ 7 background 10 1 absent Misconfiguration: priority 10 is not allowed. ❌ ✅ 8 background 10 1 present Misconfiguration:priority 10 is not allowed. alert/sound/badge is not allowed. ❌ ✅ 9 alert 5 0 absent Misconfiguration: alert/sound/badge should not be absent. ❌ ❌ 10 alert 5 0 present Correct configuration: Alert is shown w/o waking up the app. ✅ ❌ 11 alert 5 1 absent Misconfiguration: alert/sound/badge should not be absent. ❌ ❌ 12 alert 5 1 present Correct configuration: Alert is shown with waking up the app. ✅ ✅ 13 alert 10 0 absent Misconfiguration: alert/sound/badge should not be absent. ❌ ❌ 14 alert 10 0 present Correct configuration: Alert is shown w/o waking up the app. ✅ ❌ 15 alert 10 1 absent Misconfiguration: alert/sound/badge should not be absent. ❌ ❌ 16 alert 10 1 present Correct configuration: Alert is shown with waking up the app. ✅ ✅
Posted
by ptm_cc.
Last updated
.