Notifications

RSS for tag

Learn about the technical aspects of notification delivery on device, including notification types, priorities, and notification center management.

Notifications Documentation

Post

Replies

Boosts

Views

Activity

Unable to select sandbox certificate to my provisioning profile
Dear All, I am facing issue while creating provisioning profile with the certificate which has APNS service enable. I am able to Register new “Identifiers with my new bundle id and all required cabability” . Also able to create certificate with Service for (Sandbox and Sandbox & Production) During the creating the certificate, I am able to choose my newels register Identifiers. Now my issue is When I am creating the Profile for same , I am able to choose my identifiers but unbale to choose the certificate (which I have created for APNS).
0
0
241
Oct ’23
Changes to light/dark mode aren't detectable within a notification service extension unless the phone is restarted
UPDATE: So I discovered that if UIScreen.main.traitCollection.userInterfaceStyle is called in a notification service extension then it doesn't detect any change to the iPhones light/dark mode unless the phone is restarted. (I tried with other extensions, changes are detected immediately in other extensions, however not with a notification service extension nor in a notification content extension). ORIGINAL POSTING: I've got a notification service extension which is populating the notification with images before it's displayed. The images are part of an image set with different images for light and dark modes. What I've discovered is that which image is displayed in the notification depends upon whatever mode the phone was in when the app was installed or when the phone was restarted and it will stay like that for any subsequent posted notifications forever regardless of what the phone's light/dark mode setting is, unless the phone is restarted. Here's an example to illustrate what I mean, here's an image set in the Media.xcassets for the extension, its called "Grunt". And here's some code in the extension: notificationContent!.title = "GRUNT" if let url = URL(forImageResource: "Grunt") { do { let attachment = try UNNotificationAttachment(identifier: "imageAttachment", url: url) notificationContent!.attachments = [attachment] } catch { NSLog("error") } } contentHandler(notificationContent!) When the app is installed, if the phone is set to light mode, then when a notification is posted the 2x Light image is displayed in the notification. If the phone's setting is then changed to dark, then the 2x Light image still continues to displayed in all subsequent notifications that get posted. Conversely, if the phone is set to dark mode when the app is installed then the 2x Dark image is displayed in a notification, similarly if the phone's settings are changed to Light, the Dark image continues to be displayed for any new notifications posted. Until the phone is restarted - then any new notification display in accordance with whatever the phone's dark mode is set to at the time the phone is restarted. In other words, if the phone's light/dark mode setting is changed, new notifications posted don't display the appropriate light/dark image from the image set unless the phone is restarted. (Occurs with both iOS 16 and 17)
2
0
677
Oct ’23
Background audio not playing on iPhone 13+
Hello everyone, I'm using Flutter and the just_audio package. When a user receives a push notification, the app plays audio in the background. I've tested this functionality on iPhone 6s and iPhone 13. It works correctly on iPhone 6s and the app plays the sound on push notification received. However on iPhone 13 the app receives the notification, starts the background process but fails to play the sound with these errors: mediaserverd(MediaExperience)[17680] <Notice>: -CMSUtilities- CMSUtility_IsAllowedToStartPlaying: Client sid:0x45107e5, Runner(28933), 'prim' with category MediaPlayback and mode Default and mixable does not have assertions to start mixable playback mediaserverd(MediaExperience)[17680] <Notice>: -CMSessionMgr- MXCoreSessionBeginInterruption_WithSecTaskAndFlags: CMSessionBeginInterruption failed as client 'sid:0x45107e5, Runner(28933), 'prim'' has insufficient privileges to take control mediaserverd(AudioSessionServer)[17680] <Error>: AudioSessionServerImp.mm:405 { "action":"cm_session_begin_interruption", "error":"translating CM session error", "session":{"ID":"0x45107e5","name":"Runner(28933)"}, "details":{"calling_line":879,"error_code":-16980,"error_string":"Operation denied. Cannot start playing"} } From what I understand of these errors is that on the newer iPhones, there must be additional permissions. Does anyone have any idea on how I can fix this?
1
0
947
Oct ’23
Unable to select Sandbox certificate during creating provisioning profile
Here my issue is only, during creating a provisioning certificate, I am able to register bundle ID for push notification, also able to generate new certificate with same bundleID and with service either sandbox or sandbox as well as production. Now the issue is while creating the provisioning certificate, I am able to select the bundle ID which I have created for push notification service, But when page navigate to select certificate, in the existing certificate list, I am not able to find the certificate which in have created for sandbox or sandbox as well as production. I just wanted to know, does any changes made by apple for same service, does any agreement or Terms we need to accept. The links you have shared, I am doing the same way only. But no luck.
0
0
269
Oct ’23
Is INSendMessageIntent only for Message related notificaions?
In this screenshot, instead of the app logo only, there is a image of the person that messaged the user. I think this is possible by using an INSendMessageIntent with an INPerson. Apple Wallet notifications however, use a similar design. So should/can we use the INSendMessageIntent with an INPerson for non Message/Person related content? Or is there another way to achieve Apple-Wallets notification style?
0
0
293
Oct ’23
How to create an `UNNotificationAttachment` with an Image that uses UNNotificationAttachmentOptionsThumbnailClippingRectKey to select only a portion of the image?
The code compiles, however it shows the image just like without options: let options: [AnyHashable: Any] = [ UNNotificationAttachmentOptionsThumbnailClippingRectKey: CGRect( origin: CGPoint(x: 0.1, y: 0.1), size: CGSize(width: 0.1, height: 0.1) ) ] let attachment = try? UNNotificationAttachment( identifier: image.url, url: fileUrl, options: options ) The documentation says I should use CGRectCreateDictionaryRepresentation but it is not available. Cannot find 'CGRectCreateDictionaryRepresentation' in scope Am I missing something?
0
0
247
Oct ’23
How to check status of apns-unique-id
Hi there, I am hitting this curl request and getting 200 response code ( curl -v -d '{"aps":{"alert":"Test VoIP Push","sound":"default"}}' \ -H "apns-topic: com.chilll.dev.voip" \ -H "apns-push-type: voip" \ -H "authorization: bearer ${JWT}" \ --http2 \ --cert /Users/md/Documents/Chilll\ Certificates/voip_services_dev.pem \ https://api.sandbox.push.apple.com/3/device/4b4a3fbf7c0e91fb1ee54e562a621467e21275c8ea1afc78ae6c5303cd765464 ) but I want to check the status of the VoIP token, In this case I'm getting 405 response code and this error - {"reason":"MethodNotAllowed"} when hitting this curl request (curl -v -X GET \ -H "apns-topic: com.chilll.dev.voip" \ -H "authorization: bearer ${JWT}" \ --http2 \ https://api.sandbox.push.apple.com/3/device/4b4a3fbf7c0e91fb1ee54e562a621467e21275c8ea1afc78ae6c5303cd765464/status/75556da2-cd29-4113-3354-3f3969c0a7de ). So I'm kind of stuck. Could you please assist me with the solution as soon as possible. Thanks Mahesh Kumar
1
0
349
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
457
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
379
Oct ’23
Remote Notification Launch APP in background
i does not implementation background push notification in my app. however i found my app launch in background(applicationState is equal to background inapplicationDidFinishLaunch method) and launchOptions contained UIApplicationLaunchOptionsRemoteNotificationKey. the value of UIApplicationLaunchOptionsRemoteNotificationKey does not contained content-available : 1 is it a bug or sepcial case ?
0
0
423
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
795
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
327
Oct ’23
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
Live activity push token update condition
In this link, there is a description of live activity push token update: "The push token for a Live Activity may change throughout its duration. When your app receives a new token, it receives foreground runtime to process the updated token. Keep track of the push token for each Live Activity. Additionally, invalidate an outdated token on your server when you receive an updated token to successfully send subsequent updates." Our application did implement the solution to prepare for push token update. But so far, we don't see any occurrence of push token update from our backend records. The pushtokenupdates sequence only return the token once after live activity starts and does not emit more value afterward. Could you share a bit more on the condition for push token update? Under what circumstances will this happen? Thank you!
1
0
682
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
Nov ’23
notification iOS
I'm using the flutter_local_notificationspackage to display notifications in and outside the app (background mode). Everything is working as expected on Android (debug + release) and iOS debug mode but, strangely, local notifications are not displayed in background mode for iOS release. I don't know why the iOS release mode behaves differently, any thoughts? Thanks. What I already checked: use of the latest version of the flutter_local_notifications package (v16.1.0) checking "Signing & Capabilities" for both debug and release mode (Background modes : fetch, remote notifications)
0
0
377
Nov ’23