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

New delivery metrics now available in the Push Notifications Console
The Push Notifications Console now includes metrics for notifications sent in production through the Apple Push Notification service (APNs). With the console’s intuitive interface, you’ll get an aggregated view of delivery statuses and insights into various statistics for notifications, including a detailed breakdown based on push type and priority. Introduced at WWDC23, the Push Notifications Console makes it easy to send test notifications to Apple devices through APNs. Learn more.
0
0
426
Oct ’23
Problems with APNS (push notifications feedback)
Hello here,I am having issues to connect to 'feedback.push.apple.com:2196' for feedback push notifications. My PHP script has been working perfectly until I have renewed the push notification .pem certificate, but now it gives me this error:PHP Warning: stream_socket_client(): Failed to enable crypto in myscript.php on line 10Fact is: the new certificate works because I am able to send out push notifications to my app users, so, where is the problem??!!Here is the PHP script I am using to connect to the service ( I left out the part working on the returned data which is irrilevant for the connection issue):$passphrase = 'mypw'; $stream_context = stream_context_create(); stream_context_set_option($stream_context, 'ssl', 'local_cert', '/path/to/mycertificate.pem'); stream_context_set_option($stream_context, 'ssl', 'passphrase', $passphrase); $apns = stream_socket_client('ssl://feedback.push.apple.com:2196', $errcode, $errstr, 60, STREAM_CLIENT_CONNECT, $stream_context); if(!$apns) { echo "ERROR $errcode: $errstr\n"; return; } ///Read data here... fclose($apns);Any ideas are very welcome!Thanks to everyone in advance.Fab.
2
1
2.3k
Sep ’23
Silent Notification
I am trying to implement silent push notification in my application where I need to update some data in the server when silent notification comes. I am using Pushkit and it uses VoIP certificate for silent push notification but the app has been rejectd by Apple saying that "I can't use VoIP" certificate. It seems that apple has rejected it as I don't have any VoIP call functionality in my app. In that case how can I implement silent push notification so that my app gets activated even if it is not runnning(not even in the background) and I can update the server?
4
0
4k
Jul ’23
Ios flashlight specification
We are making application of ios. The application is for Disaster prevention in Japan. Because, Recentry in Japan has many Disaster in all season. We spplied to Local government in Japan and using general public and they are using well. One of the local government request to us, they want also supply to deaf person and help whe disaster occur. Local government already has disaster prevention broadcast but it is using loudspeaker. Then, when rains heavily, it can not hear to general public. And our application is from disaster prevention broadcast and forwarding to ios smartphone. It is helpfull to general public well. We are making new application it is not only prevention broadcast text but flashlight with iphone. But after making application, the flashlight is lighting only open our application. like beloe link. But, if Deaf person using it maybe he is not notice well. Our application is already has viblation function but Deaf person put his smartphone in his bag maybe I think he never noticed that Heavy rain and tsunami. Here is our application https://apps.apple.com/jp/app/cosmocast/id1247774270?mt=8 Here is application rule for flashlight. https://stackoverflow.com/questions/32136442/iphone-flashlight-not-working-while-app-is-in-background/32137434 I want help Deaf person and also senior citizens for Heavy rain and tsunami by our application. We'd like to make a flash light at the same time as the push notification arrived. Does anyone know a good way? Thank you and Best regards. Tomita.
1
0
672
Oct ’23
Notification Service Extension Not working
Hi Team, I was trying to add NSE to my Project to show Rich messaging. Creation of the NSE target to the project - Successful. Creation of additional provisioning profile in developer portal for NSE and mapped it in XCode - Successful The APS payload contains the content-type: 1 and attachment url to download the media content - Successful. When notification arrive the will present method gets called first - Successful. The auto execution of Notification Service 'didReceive(_ request: UNNotificationRequest,          withContentHandler contentHandler: @escaping            (UNNotificationContent) - Void)' - failure. 6. Tried running the target instead of main app - failure 7. Tried attaching a debugger to get break point - failure 8. Debug and Console logs - failure 9. Additionally tried the below option from every developer suggestion but no luck. o  https://stackoverflow.com/questions/50853503/images-in-ios-push-notification o  https://stackoverflow.com/questions/51722109/unnotificationserviceextensions-didrecieve-not-called o  https://stackoverflow.com/questions/39663903/ios10-unnotificationserviceextension-not-called o  https://stackoverflow.com/questions/46463680/notificationserviceextension-not-called o  https://stackoverflow.com/questions/45483018/unnotificationserviceextension-not-working-on-iphone-5-ios-10 Could you please assist on the same to get it working as the notification service methods cannot be called explicitly and it needs to be triggered by OS. A quick, faster response and resolution is much appreciated.
12
2
15k
Aug ’23
api.sandbox.push.apple.com:443 & api.push.apple.com:443 Push notification not receiving
We have configured the push notification service (Server-provider) to communicate with APNS with hostname: api.sandbox.push.apple.com and Port: 443. APNS request is going successfully but from APNS to device (iPhone 6S ) not coming. We have whitelisted the above port and other ports also(2195, 2197). but. still not able to receive the notification. We have also cross verified with the old gateway.sandbox.push.apple.com:2195 and it's working fine but with new api.sandbox.push.apple.com:443, not working. Could someone from Apple Community help us to get resolved this issue? Thanks in advance!!
6
0
5.5k
Oct ’23
The following Swift pods cannot yet be integrated as static libraries
My goal is to get the push notifications while I get the following error The following Swift pods cannot yet be integrated as static libraries when I run pod install . I have tried the foolowing methods. pod 'GoogleUtilities', :modular_headers => true pod 'FirebaseCoreInternal', :modular_headers => true I also tried with use_modular_headers! But it didn't work out. Could some one say a solution to this issue?
1
0
3.1k
Sep ’23
Critical Alerts suppressed by Apple Watch
When an iPhone is paired with an Apple Watch and receives a critical alert, no sound is played. This makes it very easy to miss such notifications and defeats entirely the purpose of critical alerts. For context, we build an app that improves the care coordination of heart attacks. We send critical alerts to notify healthcare professionals of such emergencies. These events may occur at night, when the user does not wear the Watch, and will therefore be likely to miss the notification entirely, which can be catastrophic. I have searched online thoroughly for work-arounds but have not found anything. Others have asked this before elsewhere but have not found definitive answers: link. Is there anything we can do as developers to force critical alerts to be handled by the phone, or at least to force the phone to ring when receiving a critical alert? Edit: I am aware that in the Watch app, it is possible to prevent notifications from being mirrored by the Watch. However, this requires the end user to exit my app and navigate their settings. It is also impossible for my app to check if this was done correctly. As such, I am completely in the blind as to whether the user has set up their notifications correctly.
8
7
3.3k
Aug ’23
Convert json to p8 for APN auth key
I was trying to generate the apn auth key from apple dev account. I clicked on the download button and then the downloader downloaded the file as dowload.json format. And When opened the FCM. It requires p8 format. After that I generated another key and got it again as download(1).json. Now i cant generate more keys. How can i convert these two keys to p8 format?
1
0
771
Jul ’23
No response received for Notification Service Extension (NSE) filtering entitlement request
Hi, We need to use silent notifications in our app, even when the user kills the app. We requested Apple to get a NSE Filtering Entitlement on December 02, 2022 with follow-up number: 814879299 But after nearly 2 months, we still haven't got a response. So we also sent a TSI (Technical Support Incident) on January 09, 2023 with follow-up number: 817249684. DTS (Developer Technical Support) said that we need to use this specific entitlement and he has no involvement in the entitlement request process. We need a quick response for the NSE Filtering Entitlement because our business depends on Apple's response. @Apple, is it possible to get an estimation date for the response? @iOS_developers, how long have you been waiting for that permission?
3
0
1k
Sep ’23
didReceiveRemoteNotification Method in AppDelegate never called
Dear fellow developers, I have an issue where my didReceiveRemoteNotification method in the AppDelegate is never called. Here's what I did: I am developing a SwiftUI application for iOS 15 and 16 and am currently running tests in an iPhone 14 Pro Simulator. My Xcode version is 14.2 and the simulator is running iOS 16.2. I am of course talking about the AppDelegate's application:didReceiveRemoteNotification:fetchCompletionHandler: method, not the deprecated one. I embedded the AppDelegate in the following way: @main struct MyApp: App {     @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate ... } The integration of my AppDelegate does work in general, meaning the didFinishLaunchingWithOptions is called. I added the background modes capability to my app, including both "Remote notifications" and "Background processing". With this configuration, I would expect the AppDelegate's method to be called. I tried sending different push notifications with different payloads and headers while having the app both in the background and foreground but without success. Just to rule out mistakes on my side that are obvious to someone else, this is how I embedded the method into my AppDelegate: class AppDelegate: UIResponder, UIApplicationDelegate { ... func application( _ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void ) { print("Method called!") completionHandler(.noData) } } And here are a few payloads and headers that I tested. I tried all of the following payloads with the following headers in any combination. apns-push-type=alert or apns-push-type=background apns-priority=5 or apns-priority=10 Example 1: Visible notification { "aps": { "alert": { "body": "Test" }, "badge": 1, "content-available": 1 }, "test": "data" } Example 2: Silent notification without badge update { "aps": { "content-available": 1 }, "test": "data" } Example 3: Silent notification with empty alert block and badge update, based on ideas from this thread { "aps": { "alert": {}, "badge": 0, "content-available": 1 }, "test": "data" } As I said, no matter whether my app is in the foreground or background, the method is never called. At the same time, the userNotificationCenter(_:willPresent:withCompletionHandler:) method of the UNUserNotificationCenterDelegate is called when the app is in the foreground. At this point, I am running out of ideas what I could possibly be doing wrong, so I hope someone else has an idea what else to try.
9
5
3.5k
Sep ’23
Location Push Service Extension. CLLocationPushServiceErrorDomain Code: 1
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
2
0
879
Dec ’23
PWA PUSH NOTIFICATION ISSUES IOS 16.4+
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!!
17
4
6.0k
Jan ’24
Silent Background Push Notification not working in Release build.
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?
2
0
1.4k
Oct ’23
Localizing push notification alert messages with String Catalogs
Our app is not localized but we want to begin the localization process starting with push notifications we are going to integrate. The documentation notes: you can store your message strings in the Localizable.strings file of your app bundle and use the title-loc-key, subtitle-loc-key, and loc-key payload keys to specify which strings you want to display String Catalogs in Xcode 15 supersedes Localizable.strings. How do you support this when using String Catalogs? Do you just manually add a Localizable.xcstrings file to your project then manually add a new entry for your loc-key, and the system will find this string without issue? Or will we need to have a Localizable.strings file too?
3
0
1.8k
Aug ’23
Live Activity Push updates throttling with frequent updates
We are updating a Live Activity via push notifications quite frequently. As the documentation suggests, we are using NSSupportsLiveActivitiesFrequentUpdates for this case. We are sending all updates with apns-priority: 10. Is it still possible that iOS throttles push-updates with this setting enabled? For example we sent updates to APNS in this frequence: 2023-06-09T09:21:22.492224Z 2023-06-09T09:22:03.415876Z 2023-06-09T09:22:05.643268Z 2023-06-09T09:22:08.567353Z 2023-06-09T09:22:11.988442Z 2023-06-09T09:22:17.983494Z 2023-06-09T09:22:28.400757Z 2023-06-09T09:22:44.185622Z 2023-06-09T09:23:06.633058Z 2023-06-09T09:23:23.560052Z 2023-06-09T09:23:31.863625Z 2023-06-09T09:23:37.18351Z 2023-06-09T09:23:44.086319Z 2023-06-09T09:23:49.40655Z 2023-06-09T09:24:08.034848Z 2023-06-09T09:24:18.614194Z 2023-06-09T09:24:20.176428Z 2023-06-09T09:24:25.384654Z 2023-06-09T09:25:03.103147Z 2023-06-09T09:25:15.433726Z 2023-06-09T09:25:21.171693Z 2023-06-09T09:25:23.262028Z 2023-06-09T09:25:28.241116Z 2023-06-09T09:25:30.19816Z 2023-06-09T09:25:32.440543Z 2023-06-09T09:25:42.381815Z 2023-06-09T09:25:50.581656Z 2023-06-09T09:25:55.659846Z 2023-06-09T09:26:15.042667Z 2023-06-09T09:26:26.924626Z 2023-06-09T09:26:28.608762Z 2023-06-09T09:26:32.012874Z 2023-06-09T09:26:39.111211Z 2023-06-09T09:26:40.415326Z 2023-06-09T09:26:51.142985Z 2023-06-09T09:26:54.364073Z 2023-06-09T09:27:04.225692Z 2023-06-09T09:27:30.80347Z 2023-06-09T09:27:33.560981Z 2023-06-09T09:27:42.334313Z 2023-06-09T09:27:43.834646Z All of those were sent successfully, but at some point the activity stopped updating. The activity continued for several hours after, but was never updated again. What I checked so far: From device logs we can see that there was no updated push-token The sent content-state is correct From these observations and considering the high-frequent updates, I suspect that there is still some throttling happening here. Can anyone elaborate on this? Thanks in advance.
2
0
979
May ’24
Best first-party way to stream audio on iOS
Hi, I am currently using the third-party audio library to play audio in my app. It's worth noting that my app deals exclusively with network audio, so the audio that is stored on the network. I deal with Shoutcast streams and just remote MP3 files. Is there a way to do this with native APple APIs? My motivation is that I want to adopt Share Play, lock screen player support and other native goodies. I use Swift UI.P.S. Sorry for random tags, I am blind and the interface for choosing tags cannot be used with VoiceOver
0
0
808
Jul ’23