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

258 Posts
Sort by:
Post not yet marked as solved
1 Replies
1.1k Views
Hi, I'm testing the new web push notification feature introduced in iOS 16.4. I'm testing it in a PWA that I developed. Apparently all is working well. I can register the subscription and receive notifications. The problem is that I only receive the first three notifications sent. After receiving them, I don't receive any more until I subscribe again. Is there any limitation of notifications sent per hour or day with the same subscription token? Should I renew the subscribtion token in background frequently or it's not recommended?
Posted
by
Post not yet marked as solved
2 Replies
700 Views
With PTT we now have the possibility to wake the application up using the new PTT push notification payload. What if the device doesn't have internet access? What if the application uses Local Push Connectivity (with a Network Extension) to provide an alternative communication channel (a socket implementation in the Network Extension) in case there is no internet connection? Is there a way for the Network Extension to post this new type of PTT push notification to wake the application up?
Post not yet marked as solved
2 Replies
677 Views
Hi, How can I send push notification for point update and promos to my loyalty wallet users. Currently I get push notification Id when user install loyalty wallet and I use it for sending wallet updates. But when I tried to use this push notification id for custom APN messages it doesn't appear anywhere. Thank you.
Posted
by
Post not yet marked as solved
1 Replies
1.1k Views
I'm trying to get push tokens for Live Activities but I am getting the same token twice, Why is that? Is there any other way to get the token just once, so I can hit the API to save the token. Here's the code: Task { for await data in runningActivity.pushTokenUpdates { let myToken = data.hexString self.count += 1 print("Count \(self.count)\n" + myToken) } Output: Count 1 80dc21086f81.........646d7084805dc Count 2 80dc21086f81.........646d7084805dc I can't seem to understand why this is happening, and some times it takes significantly longer to get the tokens. Am I doing anything wrong? Please do share your thoughts. Thank you!
Posted
by
Post not yet marked as solved
2 Replies
833 Views
Hello, On one of our test devices, we stopped receiving push notifications on our app. Upon investigation we noticed that APNs is returning a 410 status code when we try to deliver a notification to this device. In our iOS code, on every launch we call the registerForRemoteNotifications() method of UIApplication to request the device token. Upon successful registration, we receive the token in our app delegate’s application(_:didRegisterForRemoteNotificationsWithDeviceToken:) method. Each time we continue to receive the same token as before, and this token continues to receive a 410 response from APNs. How can we get more info on why this token has been marked as Inactive/Expired by APNs? Why is APNs giving us the same token on device if it has been marked as Inactive/Expired? What is the best way to start receiving push notifications on this device for our app? Is it possible to get a new token without deleting and re-installing the app?
Posted
by
Post not yet marked as solved
2 Replies
786 Views
I'm following Apple guidelines to add the Location Push Service Extension to our app. I followed these steps: I applied and got approved for Location Push Service Extension. My app already asks the user for "Always" permissions for location updates I added the entitlement key com.apple.developer.location.push = TRUE I added to the project a new Target, and selected Location Push Service Extension from the iOS Application Extension group I encouter the following issue. When I run the app and call startMonitoringLocationPushes(completion:) I receive the following error: Error Domain=CLLocationPushServiceErrorDomain Code=1 "(null)" By looking at Apple documentation for CLLocationPushServiceErrorDomain, code 1 stands for: missingPushExtension An error code that indicates the app is missing a Location Push Service Extension. As mentioned beofore I already added the Location Service Extension Target to the project. Any idea of why I receive this error? Thanks
Posted
by
Post not yet marked as solved
16 Replies
5.2k Views
Hello Everyone! After push notifications were enabled we got to work on this feature. for our PWA. The problem that we are having is that they work great for a little bit and then they suddenly stop working. We thought it was our problem but after doing some research I found that many other developers are having this same issue. Push notifications work perfectly on Android but don't reach ios users. Is anyone else having the same issue? Can something be done to fix this? Thanks!!
Posted
by
Post not yet marked as solved
0 Replies
295 Views
I need to receive notification from firebase with voice which stored remotely as url and not stored in bundle folder is there any way to implement this feature
Posted
by
Post not yet marked as solved
0 Replies
229 Views
We are developing push notifications to our existing app but we are seeing some push messages being not sent , we want to check if there is any limitations in sending the number of notifications per user.we are using Twilio for sending the notifications. Any suggestions or feedback greatly appreciated!!
Posted
by
Post not yet marked as solved
0 Replies
645 Views
It is a kind of skype application. When the app goes background, after 15/20 mins when trying to call anyone of the user's extension using call functionality, I can hear the message "user is not available". I have used SIP.js and free switch for this call functionality and also i am using background timer for android and VOIP push notification for IOS. I want my app to work eventhough it was killed and also till logout. registerGlobals(); const userAgent = new UserAgent( this.getUserAgentOptions(extension, password) ); console.log("!!! SIP initiaing useragent.start"); userAgent.start().then(() => { console.log("!!! SIP inside useragent.start"); const registerer = new Registerer(userAgent, { expires: 120, refreshFrequency: 95, logConfiguration: true, }); registerer.register(); // backgroundsync BackgroundTimer.runBackgroundTimer(() => { console.log("$$$ background timer before$$$"); this.isBackgroundSyncStarted = true; // this.loadData(true); registerer.register(); // code that will be called every 3 seconds console.log("$$$ background timer after$$$"); }, 20 * 1000); if(Platform.OS == "ios"){ BackgroundTimer.start(); } console.log("!!! SIP registerer registered"); });
Posted
by
Post not yet marked as solved
0 Replies
895 Views
I have a sample app to test push notifications. The app has a Notification Service Extension to intercept remote notifications, update/enhance the content and then display it to user. But there are some scenarios where the app shouldn't end up displaying a notification to user... Like, due to slow internet, the time taken to download media content (like images) exceeds the 30 sec time limit. There are more app specific scenarios. Basically, every push received from APNS need not be shown to user. Notification Service Extension did not have this power to suppress remote notifications. In the end, it will always display a notification to user. From iOS 13.3 onwards, Notification Service Extension has the ability to filter out these remote notifications. The first step is (quoting form the documentation), This entitlement allows a notification service extension to receive remote notifications without displaying the notification to the user. To apply for this entitlement, see Request Notification Service Entitlement. When I click on the hyperlink (you need to be an account holder to view that page), Apple asks for some info like 'App Store URL', 'When extension runs, what system and network resources does it need?' and so on. I only have a sample app to help understand the aspects of notifications. I don't have any full-fledged app in AppStore... yet... and I have no clue what all my full-fledged app will be doing in the extension (since I'm just in learning stage). I only have a sample app, where I log and perform some basic string operations when my extension is invoked. Due to this, I'm unable to see the extension filtering out notifications. How does anyone test this feature? Has anyone tried it? Really appreciate any guidance. I'm not sure how to proceed..
Posted
by
Post not yet marked as solved
1 Replies
455 Views
Hello. Our team uses FCM to send push notifications. The system has been working for several years without any problems. Recently, however, push notifications have frequently failed to appear. Checking the logs shows that push notifications are reaching the device, but there seems to be a problem with the device token. Does someone know how can I fix it? apsd <APSCourier 0xc7280eb10 production>: Outstanding data received: {length = 480, bytes = 0x0affd901 81038202 04a31519 b81b05a3 ... 2231227d 0d020181 } (length 480) onInterface: NonCellular. Connected on 1 interfaces. apsd <APSCourier 0xc7280eb10 production>: Stream processing: complete yes, invalid no, length parsed 476, parameters { APSProtocolBaseToken = {length = 32, bytes = 0xa332d898 556385c2 8962f5f7 f1eea558 ... acbe6d1a 7b68b011 }; APSProtocolCommand = 10; APSProtocolMessageExpiry = "XXXX-XX-XX XX:XX:XX +XXXX"; APSProtocolMessageID = {length = 4, bytes = 0x1bb81915}; APSProtocolMessagePriority = 10; APSProtocolMessagePushType = 8; APSProtocolMessageTimestamp = 1683523065106797829; APSProtocolPayload = {length = 402, bytes = 0x7b226763 6d2e6d65 73736167 655f6964 ... 2e65223a 2231227d }; APSProtocolToken = {length = 32, bytes = 0xdff8ef9f 5505ea73 5ff068fe ccaed5a6 ... 384ca7bd 62c06dd0 }; APSProtocolTopicHash = {length = 20, bytes = 0x4026c8fa2674da30b35f2c1abbe7b58d693556fd}; } apsd Created power assertion {identifier: com.apple.apsd-delayed-keepalive-push.apple.com-NonCellular} apsd <APSCourier 0xc7280eb10 production> incoming message is for proxy client that is *not* connected. baseToken {length = 32, bytes = 0xa332d898 556385c2 8962f5f7 f1eea558 ... acbe6d1a 7b68b011 } destToken {length = 32, bytes = 0xdff8ef9f 5505ea73 5ff068fe ccaed5a6 ... 384ca7bd 62c06dd0 } publicTokens ( {length = 32, bytes = 0xa332d898 556385c2 8962f5f7 f1eea558 ... acbe6d1a 7b68b011 } ) apsd <APSPushHistory: 0xc7290e260> timestampForTopic? BUNDLE_ID token {length = 32, bytes = 0xdff8ef9f 5505ea73 5ff068fe ccaed5a6 ... 384ca7bd 62c06dd0 } apsd isAppSpecificTokenValid push.apple.com {length = 32, bytes = 0xdff8ef9f 5505ea73 5ff068fe ccaed5a6 ... 384ca7bd 62c06dd0 } ,PerAppToken.v0 apsd isAppSpecificTokenValid? {length = 32, bytes = 0xdff8ef9f 5505ea73 5ff068fe ccaed5a6 ... 384ca7bd 62c06dd0 } found cached token NO apsd isAppSpecificTokenValid push.apple.com {length = 32, bytes = 0xdff8ef9f 5505ea73 5ff068fe ccaed5a6 ... 384ca7bd 62c06dd0 } ,ExtendedAppToken.v1 apsd SecItemCopyMatching() returned no items found. apsd isAppSpecificTokenValid? {length = 32, bytes = 0xdff8ef9f 5505ea73 5ff068fe ccaed5a6 ... 384ca7bd 62c06dd0 } found cached token NO apsd Received incoming push notification for topic: BUNDLE_ID but for a completely unknown token {length = 32, bytes = 0xdff8ef9f 5505ea73 5ff068fe ccaed5a6 ... 384ca7bd 62c06dd0 }
Posted
by
Post not yet marked as solved
0 Replies
503 Views
Hi I'm trying to wake up the app (when closed or in background mode) when user answers a CallKit incoming call. I've overloaded the func provider(_ provider: CXProvider, perform action: CXAnswerCallAction) and it is always called but it doesn't start or enter the app. Any idea? Thanks
Posted
by
Post not yet marked as solved
0 Replies
373 Views
IOS Push Notification Sending Failed. The SSL connection could not be established, see inner exception. Stack Trace: at System.Net.Http.ConnectHelper.EstablishSslConnectionAsyncCore(Stream stream, SslClientAuthenticationOptions sslOptions, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.GetHttp2ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) at servicewithtopself.Notification.SendIOSNotification(String deviceToken, String apnsId, Int32 notificationId, String title, String category, String message, String tags) in E:\Work\Source\App_ApplePushNotifyService\Main\App_ApplePushNotifyService\Notification.cs:line 218 I encountered an issue while trying to send an iOS push notification. The error message indicates that the SSL connection could not be established, with an inner exception.I also chceked my APNs certificate valid till september 2023. I am looking for guidance on how to resolve this error and establish a successful connection for push notifications. Any assistance or suggestions would be greatly appreciated.
Posted
by
Post not yet marked as solved
1 Replies
520 Views
Hi, My macOS app's production build is crashing on start with an unhelpful crashdump. In the console, the only error in the Console is BUG IN CLIENT OF CLOUDKIT: Not entitled to listen to push notifications. Please add the 'com.apple.private.aps-connection-initiate' entitlement. Adding this entitlement to my entitlements.plist breaks the app entirely (Unsatisfied entitlements). Here is how I'm loading my persisten store: lazy var persistentContainer: NSPersistentCloudKitContainer = { let container = NSPersistentCloudKitContainer(name: "ChatModel") guard let description = container.persistentStoreDescriptions.first else { fatalError("###\(#function): Failed to retrieve a persistent store description.") } if(UserDefaults.standard.bool(forKey: StoredPreferenceKey.iCloudSync)){ description.cloudKitContainerOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: "iCloud.XXXXX") } else { description.cloudKitContainerOptions = nil } description.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey) description.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey) /* #if DEBUG do { // Use the container to initialize the development schema. try container.initializeCloudKitSchema(options: []) } catch { // Handle any errors. } #endif */ container.loadPersistentStores { description, error in if let error = error { fatalError("Unable to load persistent stores: \(error)") } } container.viewContext.automaticallyMergesChangesFromParent = true return container }() I've set up Core Data + CloudKit following the official docs, screenshots attached. The app works fine in development mode. I'm using Xcode 14.3, and I've tried with Xcode 14.2 too. Any idea ? Web results (i.e. only two relevant threads) bring no answer.
Posted
by
Post not yet marked as solved
0 Replies
266 Views
Hi everyone. Does anyone know how many APNs keys I can generate? Is it one per application or is there a general limit? I already checked the documentation but it doesn't mention anything about it.
Posted
by
Post not yet marked as solved
1 Replies
325 Views
Getting this error when trying to instal certificate in locla keychain. An error occurred. Unable to import “Apple Push Services: com.kkiasjn”. Error: -25294
Posted
by
Post not yet marked as solved
0 Replies
225 Views
I have already updated the token of APNs to refresh every 60 minutes. However, I still receive the "TooManyProviderTokenUpdates" error. I'm wondering if I would still encounter this error if there are multiple devices that need to receive notifications and they are all sent from the same server.
Posted
by
Post not yet marked as solved
1 Replies
1.2k Views
Hi there, Our app is installed on tablets provided to customer workers for performing tasks. We're currently implementing Push Notifications using AWS SNS and FCM. The goal is to send data-only (silent) push notifications to trigger a function that creates a record in the app's local DB. This approach allows us to control how the message is displayed in the foreground and background using Notifee. While this works well on Android in all states (foreground, background, killed), we're facing an issue on iOS, specifically in the release build. The silent push notifications only reach devices when the app is in the foreground, not in the background or killed states. Normal push notifications work fine, but we require the ability to send silent notifications for better processing control. Upon researching, we discovered that Apple has strict guidelines for these notifications to prioritize user experience, battery usage, spam prevention, and privacy. However, in our case, the tablets are dedicated work devices with only our app installed. Given this context, is there a reliable solution to send silent push notifications to iOS devices with the app in the background or killed states?
Posted
by
Post not yet marked as solved
0 Replies
392 Views
Hey there, I'm new to iOS. Please help me that how we know that user clicked on live Activity. This means how to track the click of live activities. And another question is How to know the notification received on the device to update the live activity. This means tracking notifications received on the device. I tried all the APNS notification delegates but nothing get happened when a live activity update push was received. Thanks.
Posted
by