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

How to download an MDM signing certificate and its trust certificates from the iOS provisioning portal
Hey, I am new to this forum and also new for apple developer. I have a company and need install MDM server for employee device management. I have already have a MDM server and now what I needed is to "Download an MDM signing certificate and its trust certificates from the iOS provisioning portal" from the doc https://developer.apple.com/documentation/devicemanagement/implementing_device_management/setting_up_push_notifications_for_your_mdm_customers I need help to tell me 1, How to Download an MDM signing certificate and its trust certificates 2, Where is the iOS provisioning portal 3, Is Apple developer account enough for this process
0
0
307
Oct ’23
CloudKit subscription only works when operation is performed in CloudKit Dashboard and not when done programmatically
I have set up a CKQuerySubscription in the default zone that sends a Push notification every time a record meeting the given criteria is deleted in a public CloudKit database. However, the notification is only sent when I delete the record via the CloudKit Dashboard and not when I delete a record programmatically. I have tried creating a record with User A on a device and then having that record deleted by User B on a different device but it doesn't result in User A getting notified. Additionally, the only case where the notification gets sent is on a device that is signed in with the iCloud account that I use for CloudKit Console. In other words, when I delete a record that was created by a user with a different iCloud account than the one I use for the CloudKit Console the notification does not get sent to that device - it's only successful on the device with the CloudKit Console iCloud account. What I expect to happen is the subscription to fire when the record in question is deleted regardless of how and by whom it is deleted. Is this possible? Any help would be appreciated.
1
1
505
Oct ’23
Triggering Push Notifications based on App Store Server Notifications
I am developing a mobile app that has a paid subscription. I am interested in triggering a push notification when users change their subscription status in the App Store - for example, if they were to turn off auto-renew on their subscription, that would trigger a push notification using APNS to offer a discount. How would I go about sending a notification to a specific user based on the Server Notification payload? It is unclear which, if any, of the response body payload can be used to identify the user. Furthermore, I need a way to associate this identification with a device token so I can send an APNS push notification to the user. I have had the notification toggle available on launch for a while. If I understand correctly, users toggling "Allow/Deny" for registerForRemoteNotifications() notifications only changes their local settings. My first instinct was to start storing user data when they consent or decline notifications on launch - I could store [some kind of user ID, notifications_allowed (bool), and the APNS device token]. That way, when receiving an App Store Server Notification, I can reference this table, then fetch their device token and send a push notification if they have agreed to notifications. However, this seems somewhat fallible because it doesn't track users who change their notification settings in their own setting later. To summarize, my questions are the following: How can I identify a user from an App Store Server Notification payload? How could I store an identifier along with the APNS device token when users consent or decline push notifications that can later be used to associate their device with an App Store Server Notification?
0
0
456
Oct ’23
Very occasionally a phone gets into a state where the OS cannot launch a notification service extension
This is about the 3rd time I've seen this now (in about 5 years of using notification service extension, however all the occurrences have been in the past couple of months so presumably its some recent instability). What happens is a push is sent to the handset and is meant to get intercepted by a notification extension, except that doesn't happen - not due to an error with the app - something internally has gone wrong with the OS. Once this starts the notification service extension can never receive pushes again until the phone is restarted after with the extension starts to receive the pushes again. I got log from the OS when it did this and found there was an RBSRequestErrorDomain Code=5 error [u A0F3A639-F287-4B0C-AADE-A6F547D91404:m (null)] [<private>(<private>)] Failed to start plugin; pkd returned an error: Error Domain=PlugInKit Code=4 "RBSLaunchRequest error trying to launch plugin com.theCompany.app.NotificationServiceExtension(A0F3A639-F287-4B0C-AADE-A6F547D91404): **Error Domain=RBSRequestErrorDomain Code=5 "Launch failed**." UserInfo={NSLocalizedFailureReason=Launch failed., **NSUnderlyingError=0x5faa61190 {Error Domain=NSPOSIXErrorDomain Code=111 "Unknown error: 111"** UserInfo={NSLocalizedDescription=**Launchd job spawn failed**}}}" UserInfo={NSLocalizedDescription=RBSLaunchRequest error trying to launch plugin com.theCompany.app.NotificationServiceExtension(A0F3A639-F287-4B0C-AADE-A6F547D91404): Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x5faa61190 {Error Domain=NSPOSIXErrorDomain Code=111 "Unknown error: 111" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}} Can file a radar but just posting here first just in case anybody from Apple know what the OS error code and hence the reason. (longer console log available)
4
1
752
Oct ’23
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
232
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
666
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] &lt;Notice&gt;: -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] &lt;Notice&gt;: -CMSessionMgr- MXCoreSessionBeginInterruption_WithSecTaskAndFlags: CMSessionBeginInterruption failed as client 'sid:0x45107e5, Runner(28933), 'prim'' has insufficient privileges to take control mediaserverd(AudioSessionServer)[17680] &lt;Error&gt;: 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
920
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
261
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
288
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
242
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" &bsol; -H "apns-push-type: voip" &bsol; -H "authorization: bearer ${JWT}" &bsol; --http2 &bsol; --cert /Users/md/Documents/Chilll&bsol; Certificates/voip_services_dev.pem &bsol; 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" &bsol; -H "authorization: bearer ${JWT}" &bsol; --http2 &bsol; 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
340
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
431
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
372
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
415
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
776
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
322
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
383
Oct ’23