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

App users receive multiple notifications. But, We sent once.
Hello. It seems that some customers are having a problem receiving Push notifications sent by our app. There is only one transmission history on the server. Some users receive only one notification, while others receive multiple notifications. There are no in-app notifications, and all notifications are sent from the server. Given this situation, we believe that there may be a problem on the OS side that receives the push notifications. We would appreciate any solutions or information you can provide. As an example, we will send you information on the actual push notification where the duplication occurred. This is occurring on iOS16 as well as iOS17. Thank you. regards. === Payload: { "aps": { "alert": { "title": "", "body": "{body}" } }, "nd_custom": { "tap_location_url": "{url}", } "send_no": "861917" }, } "show": "1" } Date and time of transmission: Nov 10, 2023 23:00:03 ===
1
0
327
Nov ’23
Synchronizing event across app users
Hi all. I'm trying to have an AHAP file start playing simultaneously for all users. My initial thought was to use a push notification to trigger this event, but not everyone receives it at the same time. Another idea is to use an HTTP server and livestream data. I would greatly appreciate any input or suggestions on how to remotely synchronize an event for all app users.
0
0
303
Nov ’23
Do I have to register an app in the App Store to use Location Push Service Extension?
I'm going to apply the Location Push Service Extension function to the app I'm currently developing. It's still in the development stage, and it hasn't been uploaded to TestFlight. When request permission for the Location Push Service Extension feature, it says App Store url is required. Can this feature be added after the app is deployed to the App Store? I tried to test it through CloudKit, but the CLLocationPushServiceErrorDomainError3" error occurred in CLLocationManager's startMonitoringLocationPushes method, so I can't test it either.
0
0
306
Nov ’23
issues with transmitting push
We are experiencing issues with transmitting MDM push. Some are successfully transmitting, but the majority are failing. The following message occurred on the server: java.util.concurrent.ExecutionException: io.netty.channel.AbstractChannel$AnnotatedSocketException: Network is unreachable: api.push.apple.com/2620:149:208:430f:0:0:0:a:443 java.util.concurrent.ExecutionException: io.netty.channel.AbstractChannel$AnnotatedSocketException: Network is unreachable: api.push.apple.com/2620:149:208:4303:0:0:0:b:443 java.util.concurrent.ExecutionException: io.netty.channel.AbstractChannel$AnnotatedSocketException: Network is unreachable: api.push.apple.com/2620:149:208:430c:0:0:0:b:443 java.util.concurrent.ExecutionException: io.netty.channel.AbstractChannel$AnnotatedSocketException: Network is unreachable: api.push.apple.com/2620:149:208:430b:0:0:0:a:443 java.util.concurrent.ExecutionException: io.netty.channel.AbstractChannel$AnnotatedSocketException: Network is unreachable: api.push.apple.com/2620:149:208:4303:0:0:0:b:443 java.util.concurrent.ExecutionException: io.netty.channel.AbstractChannel$AnnotatedSocketException: Network is unreachable: api.push.apple.com/2620:149:208:4306:0:0:0:d:443 Apple system status was normal. Since some are successfully transmitting, we suspect that the issue may not be related to the network.
6
1
1.1k
Nov ’23
Apple Scammed me
I purchase apple developer program membership i enrolled for it i paid to apple for 1 year membership they send me mail and showing my active subscription in Purchases and apple developer app also but they didn't give me appstoreconnect access what it is mean why i buy apple developer program membership ? because i want to publish my app on appstore i attached screenshot of proof that i have active membership but i didn't get access of appstoreconnect they didn't reply me on mail and on call i contacted apple developer support on call and vie email also they didn't give me any solution They not refunding my money they don't have me product for what i paid means Scam
0
0
455
Nov ’23
How to use the same .p8 file on different app flavors
Hey everyone, I'm facing the following issue: I'm using one signal as a push notification service, and I want to create two projects: staging (especially to test some backend notifications) and production. For production, I can attach the .p8 file and then we're good. For staging, if I attach the same .p8 file, I would be in trouble because I can send a notifications to a real user even being on staging environment. How should I proceed in this situation?
0
0
467
Nov ’23
Wake up a terminated app using Silent Push
According to the article linked below, it is explained that apps that have been closed by the user cannot be woken up using Silent Push. https://developer.apple.com/forums/thread/714426?login=true However, what we actually saw in iOS 16 and iOS 17 is that apps that the user has closed wake up with an Silent push and start running in the background. There was confusion about which action was right. Please help me understand this behavior.
1
0
395
Nov ’23
Location Push service extension is not fired
I'm trying to use the location push service extension for iOS, I have followed all the steps from the documentation: I asked Apple for the entitlement and put it in the app Created a new Target "Location Push Service Extension" in swift I implemented the methods inside the service I called startMonitoringLocationPushesWithCompletion: to receive the location apns token and i use it to send the push thanks to this demo and my p8 certificate I receive a 200 when sending the push and i can see on my device that the push is received because a small icon (location) is shown on the top but my service is never fired even though i tried to put console logs and attaching to the process Is there something I am missing?
1
0
378
Nov ’23
Push notifications were not successfully delivered and have bad status
Hello everyone, I have been working on a macOS app that utilizes push notifications for the past year. Up until recently, everything was functioning correctly. However, now I'm experiencing issues where push notifications are either not being delivered at all or are experiencing significant delays, sometimes up to 10 minutes. Setting the priority header to 10 hasn't made any difference. I am currently using development push notifications, but the issue persists when switching to the production environment. I'm curious if anyone else has encountered similar problems. When checking the push console, it frequently reports that the device is offline, even though it's actually online ("discarded as device was offline"). Occasionally, notifications are delivered promptly, but this is becoming increasingly infrequent. This issue has been consistently reported by our testers, particularly after they updated to macOS Sonoma. Any insights or assistance you can provide would be greatly appreciated.
9
3
2.1k
Apr ’24
Location push extension may not be awaken when device is locked
Hi, there, I am now developing a location based app, and the com.apple.developer.location.push entitlement is applied, also the extension can be awaken when the notification is received. Yet, we found that recently the extension is not awaken if the device is locked. The extension will be awaken when the device is unlocked. Is this the desinated behavior? or I just missed anything so it doesn't work as expected? Thank you, Sean Chiu
1
0
391
Oct ’23
Can an app programmatically detect if a production provisioning profile is being used? (for determination of which push environment to use)
I want to implement a scheme whereby the server gets instructed by the app during a handshake whether the server should send pushes over the Apple sandbox environment or the production environment. There's several variations where the push environment will vary depending upon the circumstances: Debug build/scheme with app installed via XCode Release build/scheme with app installed via XCode Developer distribution installed via .ipa/Apple Configurator app Ad hoc distribution installed via .ipa/Apple Configurator app App is installed from Testflight App is installed from the app store Is there a way the app can programmatically detect at run time which push server should be used and thus it can instruct the server accordingly during its handshake with it? I guess this boils down to if the app is able to programatically detect at run time if there's a production provisioning profile being used or not? Or is there some other mechanism to detect which push server should be used? There's a couple questions/answers on Stackoverflow about programatically detecting if a provisioning profile is present but they look a bit hacky and I don't know if they can be trusted to be future proof.
0
0
328
Oct ’23
Notification Service Extension didn't work correctly
Hello all. I face problem with Notification Service Extension. User mobile receive notification without any problem, payload contain mutable-content:1 inside it ( also, full example of payload is attached ), but, NSE didn't run correctly, also, original content of notification didn't saw ( in case, and there is a crash because of something wrong in app ) I checked device logs, and I see next errors: [*] Mutated notification request is nil, will supress original content; notificationRequest=7019-8D60, error=Error Domain=NSCocoaErrorDomain Code=4097 "connection from pid 487 on anonymousListener or serviceListener" UserInfo={NSDebugDescription=connection from pid 487 on anonymousListener or serviceListener}, runtime: 0.410339 [*.notificationextension] Service extension connection encountered an error: sessionUUID=88D39801-67DF-4DC7-AA70-2AD7E8634369, error=Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 505 on anonymousListener or serviceListener was invalidated: client is gone." UserInfo={NSDebugDescription=The connection from pid 505 on anonymousListener or serviceListener was invalidated: client is gone.} example of payload: "aps": { alert = { "loc-args" = ( msisdn ); "loc-key" = "key"; }; badge = 1; "content-available" = 1; "mutable-content" = 1; sound = "pnsound.aiff"; }, "m": CFG, "j": msisdn, "t": id, "n": M] This problem is face from time to time, I can't catch this problem on same build and same environment, also, this problem can occur for some time, and after that everything will be fine
3
0
797
Oct ’23
APNs Background Notification Handling
Hi all, As part of development for my app I'm wanting to utilise the Apple Push Notification service. For now, I have implemented the necessary code in an app delegate class which you can see below class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate { var window: UIWindow? func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Request permission to display alerts and play sounds. let center = UNUserNotificationCenter.current() center.requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in if granted { DispatchQueue.main.async { application.registerForRemoteNotifications() } } } // Set the delegate for the UNUserNotificationCenter UNUserNotificationCenter.current().delegate = self return true } // MARK: - APNs Registration func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { let tokenParts = deviceToken.map { data in String(format: "%02.2hhx", data) } let token = tokenParts.joined() print("Device Token: \(token)") // Send or save this token as necessary. } func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) { print("Failed to register for remote notifications with error: \(error.localizedDescription)") } // MARK: - UNUserNotificationCenterDelegate Methods // Called when a notification is delivered to a foreground app. func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.banner, .sound]) print("message received!!") } // Called when a user taps on a notification. func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { print("user tapped on banner!!") completionHandler() } // Called when a notification is delivered in the background func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { if let messageData = userInfo["yourKey"] as? [String: AnyObject] { print("Background Notification received!!") print(messageData) completionHandler(.newData) } else { completionHandler(.noData) } } } To test this, I've just been using the terminal Like so: curl -v \ --header "authorization: bearer $JWT" \ --header "apns-topic: $TOPIC" \ --header "apns-push-type: alert" \ --http2 \ --data '{"aps":{"alert":"Hello from Terminal!", "content-available":1}}' \ $APNS_ENDPOINT/3/device/$DEVICE_TOKEN However, despite including the "content-available" tag the didReceiveRemoteNotification function is not being called. Any idea why this is? I have made sure that all the necessary capabilities have been included (background fetch, remote notifications).
1
0
467
Oct ’23
En_US Localization always selecting default 'en' and not 'en_US'
I'm trying to add Localizable strings to translate push notifications on the device side. This works fine when adding different languages (ex: German), however I'm running into issues when trying to add a Localizable file for en_US. The default is set to the en file. I've tried setting my phone's language and region to en_US and US, as well as building my app and editing the scheme in XCode to use en_US as the locale but the notifications always get translated using the default en file, and not the en_US file. My goal is to have a separate notification translation for en_US vs for any other English locale but I'm stuck here. Any ideas would be appreciated!
1
0
380
Oct ’23
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
460
Oct ’23