Notification Center

RSS for tag

Create and manage app extensions that implement Today widgets using Notification Center.

Posts under Notification Center tag

200 Posts

Post

Replies

Boosts

Views

Activity

Reloading data and rescheduling local notifications, based on AppIntent interaction in iOS 17 Widgets and Live Activities
Hi everyone, I have two questions regarding some issues with the new iOS 17 interactive widgets and live activities. Question 1: How can I update other Widgets and/or Live Activities, based on an AppIntent interaction in either one? I have several widgets that is displaying the same information, but in different sizes (Small, Medium, Large and Lockscreen). Most of our users are using many of them together on their Lockscreen and Home Screen. When they are interacting with the AppIntent button in either the Widget og LiveActivity it does not update and vice-versa. Based on the documentation it's pretty clear that interacting with a Widget it will update the timeline for that specific widget after the .perform() in the AppIntent is returned. Unfortunately, I also need to update the LiveActivity and the other TimeLines for the rest of the widgets. I have tried to use the WidgetCenter.shared.reloadAllTimelines() but it seems like it does not update the LiveActivity or the LockScreen widgets correctly. Question 2: How can I update and reschedule the local notifications based on the interaction in the Widget and Live Activity? The app sends a local notification whenever an activity starts or stops (e.g like a pomodoro timer with intervals). Let's assume the user have setup a 30 minute activity in the app, but now decides to pause the activity from either the widget or live activity. I then want to remove the scheduled local notification that was supposed to be fired in 30 minutes. I haven't been able to read from the documentation if this is possible, but would like to know if there is any way this can be performed. Looking forward to hear if anyone have encountered the same challenges :)
1
0
995
Nov ’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)
3
0
1.2k
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
579
Nov ’23
UIApplication.willEnterForegroundNotification not fired when Notification Center puts app in background
Using addObserver func of NotificationCenter.default, subscribing to UIApplication.willEnterForegroundNotification does not work when the backgrounding is triggered from Notification Center (swipe down from top when app is active to get Notification Center).  It also seems that UIApplication.willResignActiveNotification is called twice, based on Print() logs, when Notification Center triggers the backgrounding. If you background the app via lock screen or manual swipe, or switch to another app, the UIApplication.willEnterForegroundNotification does get called, so it seems to be specific to Notification Center. UIApplication.willResignActiveNotification does fire correctly but then resuming the app never calls the appMovedToForeground func below: notificationCenter.addObserver(self, selector: #selector(appMovedToForeground), name: UIApplication.willEnterForegroundNotification,object: nil) occurs on: iOS 14.4.2, iPhone 11 & iOS 14.6, SE(2)
3
0
6.7k
Nov ’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
1.6k
Oct ’23
How to reverse the Notification (Local or Push) tap behaviour
I want to change the notification tap behaviour. As we know that default behaviour of notification is when we tap or touch on notification then it opens the app and when we press and hold (long press) the notification then its shows the notification preview (should become interactive notification) and we can interact through notification without opening the app. 
But I want to reverse the default behaviour of notification i.e. when we tap or touch on the notification then it should open the notification preview (should become interactive notification) and we can interact through notification without opening the and when we press and hold the notification then it should open the app.

Could you please guild me how can I implement this notification feature.
2
1
1.1k
Oct ’23
Crash: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out : EXC_BAD_ACCESS KERN_INVALID_ADDRESS
As iOS 17 has begun to roll out, our team has noticed a crash increasing in our production application. This crash revolves around UNUserNotificationCenter and calling .getNotificationSettings(completionHandler:) in order to retrieve the users UNNotificationSettings. Upon adding extra logging to our production app, we've determined that in the callback of getNotificationSettings, trying to access the returned value UNNotificationSettings is what's crashing our app. Here's our stacktrace: Crashed: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 0 libswiftCore.dylib 0x3fd3ec swift_getObjectType + 40 1 libswiftCore.dylib 0xd660c _print_unlocked<A, B>(_:_:) + 348 2 OurApp 0x23f8ec closure #1 in closure #1 in MessagingPermissionsModel.authorizationStatus.getter + 155 (MessagingPermissionsModel.swift:155) 3 OurApp 0x8bd98 partial apply for closure #1 in UNUserNotificationCenter.getNotificationSettings(completionHandler:) + 28 4 OurApp 0x8b9bc thunk for @escaping @callee_guaranteed (@guaranteed UNNotificationSettings) -> () + 52 (<compiler-generated>:52) 5 libdispatch.dylib 0x26a8 _dispatch_call_block_and_release + 32 6 libdispatch.dylib 0x4300 _dispatch_client_callout + 20 7 libdispatch.dylib 0xb894 _dispatch_lane_serial_drain + 748 8 libdispatch.dylib 0xc3f8 _dispatch_lane_invoke + 432 9 libdispatch.dylib 0x17004 _dispatch_root_queue_drain_deferred_wlh + 288 10 libdispatch.dylib 0x16878 _dispatch_workloop_worker_thread + 404 Here is also the variable in which this crash is happening (along with our extra logging). We wrap the auth status in a RxSwift single for subscribers. 149 private var authorizationStatus: Single<UNAuthorizationStatus> { 150 Logger.debug("MessagingPermissionsModel.authorizationStatus GET") 151 return Single.create { [weak self] observer -> Disposable in 152 Logger.debug("MessagingPermissionsModel.authorizationStatus Single created") 153 self?.userNotificationCenter.getNotifictionSettings { [weak self] settings in 154 Logger.debug("MessagingPermissionsModel.authorizationStatus Retrieved notification settings") 155 (Crashes here) Logger.debug("MessagingPermissionsModel.authorizationStatus Settings \(settings)") 156 Logger.debug("MessagingPermissionsModel.authorizationStatus Auth Status \(settings.authorizationStatus)") 157 Logger.debug("MessagingPermissionsModel.authorizationStatus Observer \(String(describing: observer))") 158 Logger.debug("MessagingPermissionsModel.authorizationStatus Self \(String(describing: self))") 159 observer(.success(settings.authorizationStatus)) 160 Logger.debug("MessagingPermissionsModel.authorizationStatus Observer invoked") 161 } 162 Logger.debug("MessagingPermissionsModel.authorizationStatus Disposable will return") 163 return Disposables.create() 164 } 165 } From what we've seen so far, I'm lead to believe this is a bug in iOS 17.
1
2
1.3k
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
660
Oct ’23
How to clean up UNNotificationAttachments?
I use a UNNotificationServiceExtension to download an image into temporaryDirectory that is attached as an UNNotificationAttachment to the notification. FileManager.default.temporaryDirectory .appendingPathComponent(UUID(). .appendingPathExtension(image.ext) data.write(to: fileUrl) let attachment = ... attachments.append(attachment) The documentation for UNNotificationAttachment say I am responsible to manage the storage space for such attachments: The system limits the amount of storage space allocated for attachments for each app. To delete attachments, use the methods of the UNUserNotificationCenter class to remove the notification requests that contain those attachments. https://developer.apple.com/documentation/usernotifications/unnotificationattachment Do I need to check in my AppDelegate if there are any notifications that are no longer displayed and remove their files? If so, how how to get a list of notifications that are no longer displayed?
0
0
630
Oct ’23
Notification when forced UserDefaults change
Hi, I was wondering if it was possible to get a notification when there is a change to the forced defaults that my app uses. This forced defaults are sent via MDM using the com.apple.ManagedClient.preferences payload type. I've seen that UserDefaults.didChangeNotification is available but it only works if the change is made from inside the app and not if the payload gets updated by the MDM. class MySettings { private let defaults = UserDefaults(suiteName: "com.myapp.app.mysettings") init() { // Somehow register for notifications } func defaultsChanged() { // This would be called when the defaults change } }
0
0
641
Oct ’23
Apps don't play sound unless you select at least one alert display type
I've found an issue introduced in iOS 17. Apps that have notifications in CarPlay (Message, Whasta, Telegram, etc...) can play sounds without the need of displaying any notification alert. If you turn "Show in CarPlay" to off, which is the default value for all other apps, sound will not play unless you check at least one alert type.
0
0
668
Oct ’23
frameDidChangeNotification not firing under Sonoma
I have this code in my app: NotificationCenter.default.addObserver(self, selector: #selector(innerFrameDidChange), name: NSView.frameDidChangeNotification, object: mInnerTextView!) mInnerTextView is not nil I have this on initialization mInnerTextView!.postsFrameChangedNotifications = true (and, yes, ! is bad, I know, this code has not changed in years) The issue is that under Sonoma this notification is not firing nearly as often as in previous OSes. Specifically it does not fire when the window is resized, which does change the frame of mInnerTextView. Anyone have any recommendations? Thanks Howard
0
0
474
Oct ’23
notification issue ios 17
Since my last update on my iPhone I am unable to hear any notification from applications like Nest or Google Home. I have several videocameras that I need notifications and alerts from and the sound that the phone produces is ridiculous for sure will not alert me in any way. Not even vibration is possible to set. This problem needs urgent intervention, I suppose there are millions of users risking burgleries or other problems until it is not fixed.
1
0
958
Oct ’23
Multiple push notification service
my app using FCM and pushy to deliver notif at the same time, the situation that is happening now is that I am getting two similar notification banners. How do I delete/cancel one of the notification banners when one of them has appeared. How do I handle this on the frontend side? If it is not possible/not recommended, can you please provide documentation from Apple so that it is best to change it on the server side
2
0
1.9k
Sep ’23
Use default iOS notification sounds in my app
In our messenger application, we want to provide users with the ability to select notification sounds for push notifications from standard iOS sounds and ringtones (for example, Glass or Noir). In the documentation, I found only the ability to use my own sounds in .aiff, .wav, or .caf formats, having previously placed them in a bundle or in /Library/Sounds or one default sound(https://developer.apple.com/documentation/usernotifications/unnotificationsound). Can I independently place the downloaded files of the default iOS notification sounds in the bundle of the application in order to play them when receiving the notification and on the notification sound selection screen in the application? And will I have problems with such an implementation when reviewing the application?
0
1
1.2k
Sep ’23
Notification Service Extension not getting invoked in macOS
I have created a Notification service extension as target to the main MacOS application. I want to update the content of my remote notification using this extension but due to some reason the extension is not getting invoked to update my remote notification. The auto execution of the below method seems to fail for my app extension. didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) I have tried the suggested solutions in this link but it did not help. Maybe there are some differences to using Notification service for MacOS and ios that I m not aware. I am able to send normal remote notifications using the curl command, but it is not invoking the notification service extension. Below is the curl command. curl -v --header "apns-topic: $TOPIC" --header "apns-push-type: alert" --header "authorization: bearer $AUTHENTICATION_TOKEN" --data '{"aps": {"mutable-content": 1,"alert": {"title": "Encrypted title","body": "Encrypted body"}},"MEETING_ORGANIZER": "MyMeet"}' --http2 https://${APNS_HOST_NAME}/3/device/${DEVICE_TOKEN} Is there anything I m missing that is causing this problem?
0
0
641
Aug ’23
Notification Content Extension not working in MacOS
I've set up a Notification Content Extension for my app, but it's not getting called(tried both local and remote push). I've read the Apple dev guide, and I've set up everything as it says. https://developer.apple.com/documentation/usernotificationsui/customizing_the_appearance_of_notifications I've looked over the common issues (setting proper deployment targets and setting category identifiers from the backend and in the .plist) After receiving the notification, I'm not able to get the expanded view and neither is the didReceive(_ notification: UNNotification) of my extension view controller getting invoked. Is there something I'm missing while doing the extension setup, I m not able to figure out the problem? Also, I m not able to understand this note from apple "Notification content app extensions are supported only in iOS apps" when all the Notification content Extension APIs are provided for MacOS also?
0
1
878
Aug ’23
Reloading data and rescheduling local notifications, based on AppIntent interaction in iOS 17 Widgets and Live Activities
Hi everyone, I have two questions regarding some issues with the new iOS 17 interactive widgets and live activities. Question 1: How can I update other Widgets and/or Live Activities, based on an AppIntent interaction in either one? I have several widgets that is displaying the same information, but in different sizes (Small, Medium, Large and Lockscreen). Most of our users are using many of them together on their Lockscreen and Home Screen. When they are interacting with the AppIntent button in either the Widget og LiveActivity it does not update and vice-versa. Based on the documentation it's pretty clear that interacting with a Widget it will update the timeline for that specific widget after the .perform() in the AppIntent is returned. Unfortunately, I also need to update the LiveActivity and the other TimeLines for the rest of the widgets. I have tried to use the WidgetCenter.shared.reloadAllTimelines() but it seems like it does not update the LiveActivity or the LockScreen widgets correctly. Question 2: How can I update and reschedule the local notifications based on the interaction in the Widget and Live Activity? The app sends a local notification whenever an activity starts or stops (e.g like a pomodoro timer with intervals). Let's assume the user have setup a 30 minute activity in the app, but now decides to pause the activity from either the widget or live activity. I then want to remove the scheduled local notification that was supposed to be fired in 30 minutes. I haven't been able to read from the documentation if this is possible, but would like to know if there is any way this can be performed. Looking forward to hear if anyone have encountered the same challenges :)
Replies
1
Boosts
0
Views
995
Activity
Nov ’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)
Replies
3
Boosts
0
Views
1.2k
Activity
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)
Replies
0
Boosts
0
Views
579
Activity
Nov ’23
UIApplication.willEnterForegroundNotification not fired when Notification Center puts app in background
Using addObserver func of NotificationCenter.default, subscribing to UIApplication.willEnterForegroundNotification does not work when the backgrounding is triggered from Notification Center (swipe down from top when app is active to get Notification Center).  It also seems that UIApplication.willResignActiveNotification is called twice, based on Print() logs, when Notification Center triggers the backgrounding. If you background the app via lock screen or manual swipe, or switch to another app, the UIApplication.willEnterForegroundNotification does get called, so it seems to be specific to Notification Center. UIApplication.willResignActiveNotification does fire correctly but then resuming the app never calls the appMovedToForeground func below: notificationCenter.addObserver(self, selector: #selector(appMovedToForeground), name: UIApplication.willEnterForegroundNotification,object: nil) occurs on: iOS 14.4.2, iPhone 11 & iOS 14.6, SE(2)
Replies
3
Boosts
0
Views
6.7k
Activity
Nov ’23
Actionable notifications showing on iPhone but not on Apple Watch
Hi, A few days ago, I tested actionable notifications, and I get the buttons configured for the category displayed on my iPhone when I get an alert notification. The buttons used to be displayed on the apple watch as well, but now I only get "Dismiss". Any reason for that?
Replies
0
Boosts
0
Views
661
Activity
Nov ’23
Turn On Notifications of the Stand Alone App on Apple Watch
I faced the problem that I could not enable notifications for an app that works only on the apple watch. When a modal window appeared asking for permission to send notifications, I declined it. Now I can't find where to enable them.
Replies
0
Boosts
0
Views
603
Activity
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
Replies
3
Boosts
0
Views
1.6k
Activity
Oct ’23
How to reverse the Notification (Local or Push) tap behaviour
I want to change the notification tap behaviour. As we know that default behaviour of notification is when we tap or touch on notification then it opens the app and when we press and hold (long press) the notification then its shows the notification preview (should become interactive notification) and we can interact through notification without opening the app. 
But I want to reverse the default behaviour of notification i.e. when we tap or touch on the notification then it should open the notification preview (should become interactive notification) and we can interact through notification without opening the and when we press and hold the notification then it should open the app.

Could you please guild me how can I implement this notification feature.
Replies
2
Boosts
1
Views
1.1k
Activity
Oct ’23
Crash: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out : EXC_BAD_ACCESS KERN_INVALID_ADDRESS
As iOS 17 has begun to roll out, our team has noticed a crash increasing in our production application. This crash revolves around UNUserNotificationCenter and calling .getNotificationSettings(completionHandler:) in order to retrieve the users UNNotificationSettings. Upon adding extra logging to our production app, we've determined that in the callback of getNotificationSettings, trying to access the returned value UNNotificationSettings is what's crashing our app. Here's our stacktrace: Crashed: com.apple.usernotifications.UNUserNotificationServiceConnection.call-out EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000000 0 libswiftCore.dylib 0x3fd3ec swift_getObjectType + 40 1 libswiftCore.dylib 0xd660c _print_unlocked<A, B>(_:_:) + 348 2 OurApp 0x23f8ec closure #1 in closure #1 in MessagingPermissionsModel.authorizationStatus.getter + 155 (MessagingPermissionsModel.swift:155) 3 OurApp 0x8bd98 partial apply for closure #1 in UNUserNotificationCenter.getNotificationSettings(completionHandler:) + 28 4 OurApp 0x8b9bc thunk for @escaping @callee_guaranteed (@guaranteed UNNotificationSettings) -> () + 52 (<compiler-generated>:52) 5 libdispatch.dylib 0x26a8 _dispatch_call_block_and_release + 32 6 libdispatch.dylib 0x4300 _dispatch_client_callout + 20 7 libdispatch.dylib 0xb894 _dispatch_lane_serial_drain + 748 8 libdispatch.dylib 0xc3f8 _dispatch_lane_invoke + 432 9 libdispatch.dylib 0x17004 _dispatch_root_queue_drain_deferred_wlh + 288 10 libdispatch.dylib 0x16878 _dispatch_workloop_worker_thread + 404 Here is also the variable in which this crash is happening (along with our extra logging). We wrap the auth status in a RxSwift single for subscribers. 149 private var authorizationStatus: Single<UNAuthorizationStatus> { 150 Logger.debug("MessagingPermissionsModel.authorizationStatus GET") 151 return Single.create { [weak self] observer -> Disposable in 152 Logger.debug("MessagingPermissionsModel.authorizationStatus Single created") 153 self?.userNotificationCenter.getNotifictionSettings { [weak self] settings in 154 Logger.debug("MessagingPermissionsModel.authorizationStatus Retrieved notification settings") 155 (Crashes here) Logger.debug("MessagingPermissionsModel.authorizationStatus Settings \(settings)") 156 Logger.debug("MessagingPermissionsModel.authorizationStatus Auth Status \(settings.authorizationStatus)") 157 Logger.debug("MessagingPermissionsModel.authorizationStatus Observer \(String(describing: observer))") 158 Logger.debug("MessagingPermissionsModel.authorizationStatus Self \(String(describing: self))") 159 observer(.success(settings.authorizationStatus)) 160 Logger.debug("MessagingPermissionsModel.authorizationStatus Observer invoked") 161 } 162 Logger.debug("MessagingPermissionsModel.authorizationStatus Disposable will return") 163 return Disposables.create() 164 } 165 } From what we've seen so far, I'm lead to believe this is a bug in iOS 17.
Replies
1
Boosts
2
Views
1.3k
Activity
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 ?
Replies
0
Boosts
0
Views
660
Activity
Oct ’23
How to clean up UNNotificationAttachments?
I use a UNNotificationServiceExtension to download an image into temporaryDirectory that is attached as an UNNotificationAttachment to the notification. FileManager.default.temporaryDirectory .appendingPathComponent(UUID(). .appendingPathExtension(image.ext) data.write(to: fileUrl) let attachment = ... attachments.append(attachment) The documentation for UNNotificationAttachment say I am responsible to manage the storage space for such attachments: The system limits the amount of storage space allocated for attachments for each app. To delete attachments, use the methods of the UNUserNotificationCenter class to remove the notification requests that contain those attachments. https://developer.apple.com/documentation/usernotifications/unnotificationattachment Do I need to check in my AppDelegate if there are any notifications that are no longer displayed and remove their files? If so, how how to get a list of notifications that are no longer displayed?
Replies
0
Boosts
0
Views
630
Activity
Oct ’23
Notification when forced UserDefaults change
Hi, I was wondering if it was possible to get a notification when there is a change to the forced defaults that my app uses. This forced defaults are sent via MDM using the com.apple.ManagedClient.preferences payload type. I've seen that UserDefaults.didChangeNotification is available but it only works if the change is made from inside the app and not if the payload gets updated by the MDM. class MySettings { private let defaults = UserDefaults(suiteName: "com.myapp.app.mysettings") init() { // Somehow register for notifications } func defaultsChanged() { // This would be called when the defaults change } }
Replies
0
Boosts
0
Views
641
Activity
Oct ’23
Apps don't play sound unless you select at least one alert display type
I've found an issue introduced in iOS 17. Apps that have notifications in CarPlay (Message, Whasta, Telegram, etc...) can play sounds without the need of displaying any notification alert. If you turn "Show in CarPlay" to off, which is the default value for all other apps, sound will not play unless you check at least one alert type.
Replies
0
Boosts
0
Views
668
Activity
Oct ’23
iOS 17.0.3 Home Screen Widgets Flicker
The Widgets and the tiles in notification centre are flicketing after 17.0.3 update. What is wrong and How do I fix this?
Replies
0
Boosts
0
Views
593
Activity
Oct ’23
frameDidChangeNotification not firing under Sonoma
I have this code in my app: NotificationCenter.default.addObserver(self, selector: #selector(innerFrameDidChange), name: NSView.frameDidChangeNotification, object: mInnerTextView!) mInnerTextView is not nil I have this on initialization mInnerTextView!.postsFrameChangedNotifications = true (and, yes, ! is bad, I know, this code has not changed in years) The issue is that under Sonoma this notification is not firing nearly as often as in previous OSes. Specifically it does not fire when the window is resized, which does change the frame of mInnerTextView. Anyone have any recommendations? Thanks Howard
Replies
0
Boosts
0
Views
474
Activity
Oct ’23
notification issue ios 17
Since my last update on my iPhone I am unable to hear any notification from applications like Nest or Google Home. I have several videocameras that I need notifications and alerts from and the sound that the phone produces is ridiculous for sure will not alert me in any way. Not even vibration is possible to set. This problem needs urgent intervention, I suppose there are millions of users risking burgleries or other problems until it is not fixed.
Replies
1
Boosts
0
Views
958
Activity
Oct ’23
Multiple push notification service
my app using FCM and pushy to deliver notif at the same time, the situation that is happening now is that I am getting two similar notification banners. How do I delete/cancel one of the notification banners when one of them has appeared. How do I handle this on the frontend side? If it is not possible/not recommended, can you please provide documentation from Apple so that it is best to change it on the server side
Replies
2
Boosts
0
Views
1.9k
Activity
Sep ’23
Use default iOS notification sounds in my app
In our messenger application, we want to provide users with the ability to select notification sounds for push notifications from standard iOS sounds and ringtones (for example, Glass or Noir). In the documentation, I found only the ability to use my own sounds in .aiff, .wav, or .caf formats, having previously placed them in a bundle or in /Library/Sounds or one default sound(https://developer.apple.com/documentation/usernotifications/unnotificationsound). Can I independently place the downloaded files of the default iOS notification sounds in the bundle of the application in order to play them when receiving the notification and on the notification sound selection screen in the application? And will I have problems with such an implementation when reviewing the application?
Replies
0
Boosts
1
Views
1.2k
Activity
Sep ’23
Notification Service Extension not getting invoked in macOS
I have created a Notification service extension as target to the main MacOS application. I want to update the content of my remote notification using this extension but due to some reason the extension is not getting invoked to update my remote notification. The auto execution of the below method seems to fail for my app extension. didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) I have tried the suggested solutions in this link but it did not help. Maybe there are some differences to using Notification service for MacOS and ios that I m not aware. I am able to send normal remote notifications using the curl command, but it is not invoking the notification service extension. Below is the curl command. curl -v --header "apns-topic: $TOPIC" --header "apns-push-type: alert" --header "authorization: bearer $AUTHENTICATION_TOKEN" --data '{"aps": {"mutable-content": 1,"alert": {"title": "Encrypted title","body": "Encrypted body"}},"MEETING_ORGANIZER": "MyMeet"}' --http2 https://${APNS_HOST_NAME}/3/device/${DEVICE_TOKEN} Is there anything I m missing that is causing this problem?
Replies
0
Boosts
0
Views
641
Activity
Aug ’23
Notification Content Extension not working in MacOS
I've set up a Notification Content Extension for my app, but it's not getting called(tried both local and remote push). I've read the Apple dev guide, and I've set up everything as it says. https://developer.apple.com/documentation/usernotificationsui/customizing_the_appearance_of_notifications I've looked over the common issues (setting proper deployment targets and setting category identifiers from the backend and in the .plist) After receiving the notification, I'm not able to get the expanded view and neither is the didReceive(_ notification: UNNotification) of my extension view controller getting invoked. Is there something I'm missing while doing the extension setup, I m not able to figure out the problem? Also, I m not able to understand this note from apple "Notification content app extensions are supported only in iOS apps" when all the Notification content Extension APIs are provided for MacOS also?
Replies
0
Boosts
1
Views
878
Activity
Aug ’23