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

Posts under APNS tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Issue with APNS Token Registration on iOS 16.7.1 - Firebase FCM Token Generated but Register Device Token delegate Not Called
I'm currently facing an issue with APNS token registration on iOS 16.7.1 specifically for iPhone 8+. I'm working on integrating Firebase into my iOS app for push notifications. Problem: The problem I'm encountering is that the didRegisterForRemoteNotificationsWithDeviceToken and didFailToRegisterForRemoteNotificationsWithError delegates are not being called at all, despite Firebase successfully generating the FCM token. Environment: Device: iPhone 8+ iOS Version: 16.7.1 Xcode Version: latest Swift Version: latest Firebase SDK Version: latest Observations: Firebase successfully generates the FCM token, indicating that the device is able to connect to Firebase Cloud Messaging. However, the standard APNS delegate methods (didRegisterForRemoteNotificationsWithDeviceToken and didFailToRegisterForRemoteNotificationsWithError) are not being triggered. This issue seems specific to iOS 16.7.1 on the iPhone 8+. I already tested on other iphone its work normaly. Steps Taken: 1.Ensured that APNS is properly configured in the Apple Developer Console. 2.Firebase is set up correctly, as evidenced by the successful generation of FCM tokens. 3. No relevant errors or warnings in the Xcode console. Question: Has anyone else experienced a similar issue on iOS 16.7.1 or with iPhone 8+ devices? Any insights or suggestions on how to troubleshoot and resolve this issue would be greatly appreciated. Thank you in advance for your time and assistance! Additional Information: If you need more information or code snippets, please let me know. If there's a more appropriate place to post this issue or if it has already been addressed, kindly guide me.
1
0
538
Dec ’23
Issue with APN entitlement on iOS - Xcode 15
I have been pulling out my hair the past day over this. I am adding push / remote notifications (using FCM) and running into an issue with the APN entitlement not being added to provisioning profile - using automatic signing. Now I am somewhat of a new / hobbyist developer but I'm sure I've covered all the bases: Have added (and removed and re-added) the capability in Xcode. Created (and recreated) the APN key in the developer portal (combined with Sign in with Apple) AppDelegate is fine FCM returns a device key without issue. Cleaned build folder and rebuilt app Despite this I am still getting "10.18.0 [FirebaseMessaging][I-FCM012002] Error in application:didFailToRegisterForRemoteNotificationsWithError: no valid *aps-environment" entitlement string found for application" error. Include is a screen capture of the automatically generated profile which seems to illustrate the issue. Any and all advice is greatly appreciated ;)
3
0
1.5k
Dec ’23
Registering for remote notifications not working on physical device
Hi there, There might be something obvious I'm overlooking, but I can't for the life of me figure it out. Any help or guidance would be much appreciated! I've enabled push notifications for one of my app identifiers (developer portal and provisioning profile appear to be correct, as does the entitlements file). On a simulator, when I call registerForRemoteNotifications(), I immediately get a callback from didRegisterForRemoteNotificationsWithDeviceToken. However, when I run my app on any of my physical devices, this method is never called. Nor is didFailToRegisterForRemoteNotificationsWithError. If I manually remove the aps-environment key and deploy to my device, then didFailToRegisterForRemoteNotificationsWithError is invoked with an expected error message. Any idea what I may have done wrong here? I'm using Xcode 15.0.1 and have tried an iPhone 12 (iOS 15.5) and iPhone 13 Pro Max (iOS 16.7.2). My development environment requires a VPN, but I've tried disabling the VPN in case that was an issue. I've also tried restarting the devices and toggling Wi-Fi, airplane mode, etc. My app does integrate with Firebase (not FCM though), but I added the FirebaseAppDelegateProxyEnabled NO option, just in case (this wouldn't explain why it works on Simulator though). Thanks for your help!
0
0
563
Dec ’23
How exactly do I get push tokens from a Live Activity that was started remotely?
In iOS 17.2+, we have a new feature that lets you use a push notification to start a Live Activity. The docs mention this: While the system starts the new Live Activity and wakes up your app, you receive the push token you use for updates. How exactly does this work? I don’t see any listeners/delegate methods that trigger when you receive a start event. Since I need to extract the push tokens from a specific instance, how do I get that instance? I can call Activity<MyType>.activities to see all running Live Activities, but assuming my end user has multiple instances running, how do I locate the instance that was started remotely?
2
0
652
Dec ’23
DeviceTokenNotForTopic
Some users couldn't receive push notifications, and APNS returned a 'DeviceTokenNotForTopic' error. Upon validation using Apple's tool, I found that some tokens are identified as VoIP push tokens, and some as Live Activity (LA) push tokens. When attempting to send a normal alert push using these VoIP/LA push tokens, it didn't work and returned a 'DeviceTokenNotForTopic' error. These tokens were obtained from Apple's delegate function 'didRegisterForRemoteNotificationsWithDeviceToken.' It's unexpected to receive VoIP/LA push tokens from this event, but this issue is occurring, and I've observed it specifically in iOS 17 users. This problem is not universal and is happening only for some users. Please take note that our app support VoIP Push, Live Activity Push and Normal Push notification. Could this be an iOS 17 bug? Any advice on this matter would be appreciated. Thanks.
1
0
1.5k
Dec ’23
Delay in APNS push after device move from offline to online.
We send multiple pushes while the device is offline and when we get back online we expect to get the last one. Our understanding is that Apple store only the last push and it will be immediately delivered when we get back online. But in some cases we are not receiving this last push when we come back online. strange part is if we send one more push we receive the missed one and the last push we send.
0
0
226
Dec ’23
location push service extension
I have recently been approved for the location push service extension. I do not have as much experience working directly in swift. I am trying to Implement so that when this Location Push Notification is received by the device it responds to the server with the current location. I have the proper APNS set up and have already been approved. Is there a step by step guide to help implement this feature.
2
0
504
Dec ’23
"Invalid Certificate Signing Request" error prevents certificate renewal on Apple Push Certificates Portal site
When attempting to renew a certificate after December 18, 2023, an error may be displayed, preventing the renewal of the certificate. It seems that repeating the process multiple times can occasionally lead to success, indicating that there is no issue with the CSR file. This occurrence has been observed in multiple MDM services, including Intune, Work Space One, and various other MDM vendors, suggesting a malfunction with Apple's servers. We hope that this issue will be promptly resolved and fixed. Although unrelated to the previous issue, when pressing "Manage Certificates," it redirects back to the login screen instead of returning to the certificate list page. Please fix this so that it returns to the certificate list page.
7
1
1.9k
Jan ’24
About ports to open to communicate with APNs
I'm an engineer at an MDM vendor. MDM push to devices via Apple Push Notification Service (APNs). According to the document below, port 5223 needs to be opened in order for the device to communicate with APNs. https://support.apple.com/ja-jp/guide/deployment/dep2de55389a/web https://support.apple.com/ja-jp/102266 https://support.apple.com/ja-jp/HT210060 Does this port need to be open for both in and out? Or should I only open out? in : APNs → iOS Device out: iOS Device → APNs
0
0
268
Dec ’23
Remote (background) notifications not arriving on macOS
I have an iOS and native macOS app that is configured to receive remote (background) notifications. I've verified that the background notifications are being received on iOS. I'm sending the notifications from my server, and my app also receives CloudKit notifications on iOS. But neither of these is received on macOS. I've found two recent discussions that indicate that other users are experiencing this problem: https://stackoverflow.com/questions/74868553/apple-push-notifications-arriving-on-macos-but-not-in-the-application-itself https://github.com/raivo-otp/macos-receiver/issues/15
2
0
398
Dec ’23
APNs Pushes Failing, Device is "offline" when it's not
Hi - I'm having issuses with pushing notifications both locally and from a server to either my phone or the simulator. KEEP IN MIND I had previously had them working not an hour ago, and for some reason, after changing no code i come back to errors upon errors. I am using 17.0.2 and xcode. Here are some things i've tried: CloudKit's Push notification console - one day it just suddenly stopped working, and doing pushes that previously had worked suddenly gave the vague and very unhelpful error message "device was offline." I know my credentials and device token are all valid because it doesn't throw any other errors regarding that. AWS Pinpoint/SNS - i previously had it working sending push notifications from SNS. I get a 200 response, but it still doesn't show a push notification. I think Apple is misinterpreting "discarded as device was offline" somehow as a success? .apns drag-n-drop - i literally sometimes fail dragging and dropping into the simulator a properly configured .apns file to trigger a notification. Sometimes it works, sometimes it doesn't. The literal only thing i changed was adding the target of the user notifications extension (so i can add custom actions on a notification). Unless that target somehow broke everything, Apple seems to think my device is offline. Hopefully someone might have been experiencing this and can understand my fury.
2
0
1.3k
Jan ’24
Notification Service Extension usage time
Hello all. I noticed, that NSE living more than 30 seconds ( that described in doc ). When app receive notification, it created process NSE, and send notification to didReceive function, after this, app have 30 seconds to call contentHandler closure, after contentHandler is called, I expected that NSE process is killed, but it's not. If app using singletons in NSE, they won't dealloc after contentHandler is called, so, after new notification received, singletons still alive. Does it legal to not drop connection to websocket after contentHandler closure get called? For example, notification received, NSE process is loaded, websocket manager signleton is initialzied and started session, after few seconds contentHandler closure get called, so, system won't kill NSE because of 30 seconds timer, and my web socket connection will alive so long as possible, so, I not need to open it each 30 seconds, is that legal or not?)
3
0
529
Jan ’24