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

Application lifecycle - AppDelegate method Vs Notification Center
There are two ways to capture application transitioning to foregorund/background and inactive/active. Lets take the event received when app transitions to the inactive state as an example. Implement the corresponding AppDelegate method - applicationWillResignActive(_:) func applicationWillResignActive(_ application: UIApplication) { Log("applciationWillResignActive(_:)") } Register for willResignActiveNotification during startup NotificationCenter.default.addObserver(forName:UIApplication.willResignActiveNotification, object: nil, queue: .main) { (broadcastNotification: Notification) in Log("Received " + String(describing: broadcastNotification.name)) } When I tested in code, both works. First, the applicationWillResignActive(_:) delegate method is invoked and then, willResignActiveNotification is received (as mentioned in the documentation). But I'm unable to decide which to use... even after reading their documentation. What is the recommendation? If both are fine, then there are two different ways to achieve the same thing... there's gotta be some purpose, right?
2
0
1.6k
Aug ’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.
13
3
20k
Aug ’23
Announce my apps' Notifications in CarPlay
My app uses UNMutableNotificationContent() to play a custom sound, and has a phrase as a message. I just got a vehicle with CarPlay. When my iPhone is connected to CarPlay, when the notification goes off at a time, it shows on the iPhone, but does not make any noise whatsoever. What I'd like to happen, is for CarPlay to announce the message when the notification goes off, like it does with Apple's messages app. As my phone is set right now, when I have my airPods in, it will announce the notification from my app. But not for CarPlay. What do I need to add to my app to allow CarPlay to announce the message that comes in from a notification (again, local, not a push notification).
0
2
757
Aug ’23
Crash: Call must be on main thread
As Swift give as async await functions, I tried to use them for push notifications. In my case if I use extension TMNotificationCenter: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.sound, .banner, .list, .badge]) } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { completionHandler() } } There are no error, erevything works fine, but when I change to this: extension TMNotificationCenter: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions { print(#function) return [.sound, .banner, .list, .badge] } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async { print(#function) } } I got crash: What I am doing wrong?
2
0
2.3k
Aug ’23
Dynamic, Custom-UI MacOS Notifications in Notification-Center. How to?
Hi, I have a long process that I need to report to the User via UNNotificationCenter (local) notifications. Say - scanning a big folder with thousands of files, finding and reporting "bad ones" as they are identified. I currently emit periodic notifications, keeping the same "thread identifier", which causes each new notification to replace the one displayed, thus updating the texts. However - when they become many, the behavior is inconsistent and it looks bad. What I'd like to do is: Have a single DELIVERED notification (displayed on-screen) that will change its contents (say- advances a progress bar, and updates its text periodically. I KNOW that this is possible, because Apple publishes a notification almost identical to what I need in AirDrop UI. When a bunch of documents are dropped by some external device onto my Mac - I receive a notification like this: Which updates until the file transfer is finished. I searched both these forums, the documentation, and other resources, but did NOT find any hint on how to implement such thing. There's something for iOS called "App Extension" that can customize Notification UI - but I did not find any documentation or code-sample or anything - and all I found was descriptions of behavior on iOS, so I'm not sure that's the way to do it on MacOS. Can you please advise?
4
0
2.8k
Aug ’23
watchOS SwiftUI application deeplink on push notifications
Hey, I am currently trying to add deeplink handling from tapping on push notifications in my watchOS application with a SwiftUI lifecycle. I already have deeplinking working with several onOpenURL modifiers throughout the app for the iOS version. What I wanted to do, is whenever I receive a push notification I construct an URL and then utilise the onOpenURL view modifier to handle the deeplink. I currently struggle to understand if this is possible at all. I have the following setup @main struct WatchApp: App { @WKApplicationDelegateAdaptor var appDelegate: WatchAppDelegate // MARK: - Body var body: some Scene { WindowGroup { ContentView() } } } class WatchAppDelegate: NSObject, WKApplicationDelegate, ObservableObject { func applicationDidFinishLaunching() { UNUserNotificationCenter.current().delegate = self } } extension WatchAppDelegate: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async { // handle the push notification } } I do receive the the notification as expected in userNotificationCenter(center:, didReceive:) but from there on I didn't find a way bring this information into my app. On iOS I do leverage UIApplication.shared.open(url:) but this is obviously not available on watchOS. What is the official guidance of handling watchOS deep links with SwiftUI lifecycle from tapping of push notifications ? Currently the onOpenURL modifiers are placed on several views, so it would be nice if there is a way to trigger them from a central place. Would be really appreciated if someone knows a way on how to do it :)
0
0
1.2k
Jul ’23
Xcode 15 beta 5: watch face previews (accessoryRectangular/Circular) render multicolor face in tinted mode
In Xcode 15 beta 1 to 5, the watch face preview of accessoryRectangular and accessoryCircular are always rendered in tinted mode, even if you choose multicolor. (NOTE: Please don't ask me to provide diagnostic data for Preview. Because this issue is 100% reproducible.)
1
0
984
Jul ’23
Delay when posting Local notification on Apple Watch
Hi! I have some trouble with local notification delivery on Apple Watch. It can take more than 1 minute to see the first local notification delivered. I made sure to not use a trigger so the notification will be delivered right away possible as specified in the UNNotificationRequest initializer doc. But there is always a delay for notification delivery. Here is how I'm creating the local notification: content.title = "title" content.subtitle = "subtitle" content.body = "body" content.userInfo = "userInfo" content.categoryIdentifier = "categoryIdentifier" content.threadIdentifier = "threadIdentifier" content.sound = UNNotificationSound.default let notifyRequest = UNNotificationRequest(identifier: stringWithUUID(), content: content, trigger: nil) let center = UNUserNotificationCenter.current() center.add(notifyRequest) { ( error: Error?) in if let theError = error { print(theError.localizedDescription) } else { print("Scheduled OK") } } Do you have any idea how to avoid the delay? Best!
0
0
808
Jul ’23
MY COMPUTER DOESN'T OPEN ANYMORE RESOLUME ARENA
HELLO! I just bought a MacBook Pro M2 32g ssd 1t Ram thinking I had the best machine to work with videos and video's programs. I'm a visual artist, I use Resolume Arena and when I moved on the new computer my program, it starts to crash! I tried several times to install-uninstall the program and I don't know why is making that. This is what appears: Translated Report (Full Report Below) Process: Arena [935] Path: /Applications/Resolume Arena 6/Arena.app/Contents/MacOS/Arena Identifier: com.resolume.arena Version: 6.1.5 (6.1.5.68469) Code Type: X86-64 (Translated) Parent Process: launchd [1] User ID: 501 Date/Time: 2023-06-30 06:26:25.5102 +0200 OS Version: macOS 13.4 (22F66) Report Version: 12 Anonymous UUID: BBEB6B45-F295-0C98-2890-2A64E6E53977 Sleep/Wake UUID: AD36FAD9-7084-4522-9FA0-015CEAC0ABA5 Time Awake Since Boot: 230 seconds Time Since Wake: 12 seconds System Integrity Protection: enabled Crashed Thread: 9 Exception Type: EXC_ARITHMETIC (SIGFPE) Exception Codes: 0x0000000000000001, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 8 Floating point exception: 8 Terminating Process: exc handler [935] Thread 0:: Juce Message Thread Dispatch queue: com.apple.main-thread 0 ??? 0x7ff8909e69a8 ??? 1 libsystem_kernel.dylib 0x7ff800da6fbe __semwait_signal + 10 2 libsystem_c.dylib 0x7ff800c99585 nanosleep + 196 3 Arena 0x1051a4369 0x104c11000 + 5845865 4 Arena 0x1051a3c9e 0x104c11000 + 5844126 5 Arena 0x105119e60 0x104c11000 + 5279328 6 Arena 0x105119b85 0x104c11000 + 5278597 7 Arena 0x105111c87 0x104c11000 + 5246087 8 Arena 0x1055e7406 0x104c11000 + 10314758 9 Arena 0x1055e6c5c 0x104c11000 + 10312796 10 Arena 0x1055e6323 0x104c11000 + 10310435 11 Arena 0x105398455 0x104c11000 + 7894101 12 Arena 0x1058d289e 0x104c11000 + 13375646 13 Arena 0x105736756 0x104c11000 + 11687766 14 Arena 0x1051ed004 0x104c11000 + 6144004 15 Arena 0x1052dc7e1 0x104c11000 + 7124961 16 Arena 0x1051ecf14 0x104c11000 + 6143764 17 Arena 0x1051eceaf 0x104c11000 + 6143663 18 dyld 0x2067d841f start + 1903 Thread 1:: com.apple.rosetta.exceptionserver 0 runtime 0x7ff7ffdb0694 0x7ff7ffdac000 + 18068 Thread 2: 0 runtime 0x7ff7ffdce87c 0x7ff7ffdac000 + 141436 Thread 3: 0 runtime 0x7ff7ffdce87c 0x7ff7ffdac000 + 141436 Thread 4: 0 runtime 0x7ff7ffdce87c 0x7ff7ffdac000 + 141436 Thread 5: 0 ??? 0x7ff8909e69a8 ??? 1 libsystem_kernel.dylib 0x7ff800da70ee __psynch_cvwait + 10 2 libsystem_pthread.dylib 0x7ff800de3758 _pthread_cond_wait + 1242 3 Arena 0x1050707dc 0x104c11000 + 4585436 4 Arena 0x104fd5afe 0x104c11000 + 3951358 5 Arena 0x105075907 0x104c11000 + 4606215 6 libsystem_pthread.dylib 0x7ff800de31d3 _pthread_start + 125 7 libsystem_pthread.dylib 0x7ff800ddebd3 thread_start + 15
0
1
1.4k
Jun ’23
Banner of local notification from broadcast upload extension may not work.
Hi. I implemented a broadcast upload extension and it requests local notifications. The local notification works normally on broadcastStarted(withSetupInfo:), but the Banner of the local notification does not work on processSampleBuffer(_: with:) though its Notification Center works normally. What am I missing? Here is my code snippets. container app class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. requestAuthorization() ... } private func requestAuthorization() { let center = UNUserNotificationCenter.current() center.requestAuthorization(options: [.alert]) { granted, error in if let error = error { // Handle the error here. print(error) } if granted == true { center.delegate = self center.getNotificationSettings(completionHandler: { setting in print(setting) }) } else { print("not permitted") } } } } upload extension class SampleHandler: RPBroadcastSampleHandler { override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) { super.broadcastStarted(withSetupInfo: setupInfo) notification(title: "Upload Extension", body: "broadcastStarted") ... } override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) { super.processSampleBuffer(sampleBuffer, with: sampleBufferType) ... if some condition { notification(title: "Upload Extension", body: "processSampleBuffer") } } private func notification(title: String, body: String) { let content = UNMutableNotificationContent() content.title = title content.body = body let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil) let notificationCenter = UNUserNotificationCenter.current() notificationCenter.add(request) { error in if error != nil { print(error) } } } }
3
0
2.6k
Jun ’23
iPhone: All notifications from my app disappeared after a new notification arrived
lately, we found out that all notifications from the app I developed suddenly vanished for no reason when a new notification arrived. Mostly this case happened on iOS 16, and the notification has threadID by which we want to fulfill the notification grouping. When I continuously sent 4-5 notifications to my iPhone this case will happen. Problem screen recording did anyone encounter this situation? Why and how to fix it
0
0
661
Jun ’23
How to wake up app in background
Team, is there anyway, if we can wakeup the app while it is in suspended mode. I am using BLE scanning to share/receive the TCN token and generate notifications, but while app in sleep/suspended mode it stops. is there anyway to trigger this scanning or wake up the app without any manual intervention. we are trying to achieve this with help of silent notifications. can you help to figure out how many silent notification we can trigger in an hour ?
2
0
4.4k
May ’23
watchOS 9: ClockKit-based complications occasionally failed to display
Hello! Two of my watch apps (HiCoffee and HiWater) occasionally have issues with complications not displaying properly on watchOS 9. I did NOT use the new WidgetKit to implement the complications, all the related code still uses the same previous ClockKit + SwiftUI. I have observed several different types of wrong behaviors. One specific complication cannot be displayed (rendered?), while others do work (from the same app). This indicates that my watch app is working properly. All complications on the face cannot be displayed. But the app logs indicates it's running properly. In addition, when you long press the face to edit complications, yet it can be displayed normally. Log shows CLKComplicationServer.sharedInstance().activeComplications always returns 0 no matter how many complications are added to the face. Also, the ComplicationController is NOT called by system. I'm not using WatchKit. This part of the code in my app has been working properly for a long time and has not been changed. But after the release of watchOS 9, I received a lot of feedback from users with this problem. So I think the problem is in watchOS 9. I haven't found a way to reproduce the problem yet. Any suggestions please?
7
2
2.9k
May ’23
Debug Wrapper around NotificationCenter
I've been struggling with writing some dependency injection types for Foundation types like NotificationCenter, UIDevice, etc. I've created a sample package to demonstrate: https://github.com/MFB-Technologies-Inc/notification-center-client-demo. The goal is to mimic NotificationCenter's Publisher and notifications AsyncSequence. LiveNotificationCenterClientTests.testStream will fail unless it's run in isolation. If more than one test is run, it will never complete because no values are ever received from the stream. MockNotificationCenterClientTests.testPublisher fails because the expectations are not fulfilled before the timeout. For whatever reason, the published values are not being received in the sink. MockNotificationCenterClientTests.testStream never completes because the value is being endlessly awaited. It seems that there are some fundamental things about concurrency that I'm getting wrong. Can anybody help me debug this? For the two stream tests, I know I could rewrite them to fail with a timeout like the publisher tests but that's not the real problem.
0
0
937
May ’23
WatchOS Notifications Firing Late
We have a watchos app that uses notifications to display time sensitive information to the users. We are using UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false), our usernotification center looks like this func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { print("It got here to showing the notifications and this is when it is shown: \(Date()) and this is the type of notification: \(notification.request.identifier)") completionHandler([ .list, .sound, .banner ]) }. The problem is that the usernotification center is called correctly but no notification is given, every time 13 seconds later it is called twice again and only then does the notification display to the users. I have tried changing the type of trigger for the notification but even that did not get rid of the thirteen second delay.
1
0
859
May ’23
Application lifecycle - AppDelegate method Vs Notification Center
There are two ways to capture application transitioning to foregorund/background and inactive/active. Lets take the event received when app transitions to the inactive state as an example. Implement the corresponding AppDelegate method - applicationWillResignActive(_:) func applicationWillResignActive(_ application: UIApplication) { Log("applciationWillResignActive(_:)") } Register for willResignActiveNotification during startup NotificationCenter.default.addObserver(forName:UIApplication.willResignActiveNotification, object: nil, queue: .main) { (broadcastNotification: Notification) in Log("Received " + String(describing: broadcastNotification.name)) } When I tested in code, both works. First, the applicationWillResignActive(_:) delegate method is invoked and then, willResignActiveNotification is received (as mentioned in the documentation). But I'm unable to decide which to use... even after reading their documentation. What is the recommendation? If both are fine, then there are two different ways to achieve the same thing... there's gotta be some purpose, right?
Replies
2
Boosts
0
Views
1.6k
Activity
Aug ’23
Local Notiofication handling in background
I want to schedule a local notification every day at a particular time. When I receive the local notification I need to start location service irrespective of the app state. i.e. even when the app is killed or in the background I want this to be done.
Replies
0
Boosts
0
Views
516
Activity
Aug ’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.
Replies
13
Boosts
3
Views
20k
Activity
Aug ’23
Limit Reached --- Fix??
You have already reached the maximum allowed number of Keys for this service. How do I fix this?
Replies
1
Boosts
0
Views
668
Activity
Aug ’23
Announce my apps' Notifications in CarPlay
My app uses UNMutableNotificationContent() to play a custom sound, and has a phrase as a message. I just got a vehicle with CarPlay. When my iPhone is connected to CarPlay, when the notification goes off at a time, it shows on the iPhone, but does not make any noise whatsoever. What I'd like to happen, is for CarPlay to announce the message when the notification goes off, like it does with Apple's messages app. As my phone is set right now, when I have my airPods in, it will announce the notification from my app. But not for CarPlay. What do I need to add to my app to allow CarPlay to announce the message that comes in from a notification (again, local, not a push notification).
Replies
0
Boosts
2
Views
757
Activity
Aug ’23
Crash: Call must be on main thread
As Swift give as async await functions, I tried to use them for push notifications. In my case if I use extension TMNotificationCenter: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.sound, .banner, .list, .badge]) } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { completionHandler() } } There are no error, erevything works fine, but when I change to this: extension TMNotificationCenter: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification) async -> UNNotificationPresentationOptions { print(#function) return [.sound, .banner, .list, .badge] } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async { print(#function) } } I got crash: What I am doing wrong?
Replies
2
Boosts
0
Views
2.3k
Activity
Aug ’23
Dynamic, Custom-UI MacOS Notifications in Notification-Center. How to?
Hi, I have a long process that I need to report to the User via UNNotificationCenter (local) notifications. Say - scanning a big folder with thousands of files, finding and reporting "bad ones" as they are identified. I currently emit periodic notifications, keeping the same "thread identifier", which causes each new notification to replace the one displayed, thus updating the texts. However - when they become many, the behavior is inconsistent and it looks bad. What I'd like to do is: Have a single DELIVERED notification (displayed on-screen) that will change its contents (say- advances a progress bar, and updates its text periodically. I KNOW that this is possible, because Apple publishes a notification almost identical to what I need in AirDrop UI. When a bunch of documents are dropped by some external device onto my Mac - I receive a notification like this: Which updates until the file transfer is finished. I searched both these forums, the documentation, and other resources, but did NOT find any hint on how to implement such thing. There's something for iOS called "App Extension" that can customize Notification UI - but I did not find any documentation or code-sample or anything - and all I found was descriptions of behavior on iOS, so I'm not sure that's the way to do it on MacOS. Can you please advise?
Replies
4
Boosts
0
Views
2.8k
Activity
Aug ’23
watchOS SwiftUI application deeplink on push notifications
Hey, I am currently trying to add deeplink handling from tapping on push notifications in my watchOS application with a SwiftUI lifecycle. I already have deeplinking working with several onOpenURL modifiers throughout the app for the iOS version. What I wanted to do, is whenever I receive a push notification I construct an URL and then utilise the onOpenURL view modifier to handle the deeplink. I currently struggle to understand if this is possible at all. I have the following setup @main struct WatchApp: App { @WKApplicationDelegateAdaptor var appDelegate: WatchAppDelegate // MARK: - Body var body: some Scene { WindowGroup { ContentView() } } } class WatchAppDelegate: NSObject, WKApplicationDelegate, ObservableObject { func applicationDidFinishLaunching() { UNUserNotificationCenter.current().delegate = self } } extension WatchAppDelegate: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse) async { // handle the push notification } } I do receive the the notification as expected in userNotificationCenter(center:, didReceive:) but from there on I didn't find a way bring this information into my app. On iOS I do leverage UIApplication.shared.open(url:) but this is obviously not available on watchOS. What is the official guidance of handling watchOS deep links with SwiftUI lifecycle from tapping of push notifications ? Currently the onOpenURL modifiers are placed on several views, so it would be nice if there is a way to trigger them from a central place. Would be really appreciated if someone knows a way on how to do it :)
Replies
0
Boosts
0
Views
1.2k
Activity
Jul ’23
Xcode 15 beta 5: watch face previews (accessoryRectangular/Circular) render multicolor face in tinted mode
In Xcode 15 beta 1 to 5, the watch face preview of accessoryRectangular and accessoryCircular are always rendered in tinted mode, even if you choose multicolor. (NOTE: Please don't ask me to provide diagnostic data for Preview. Because this issue is 100% reproducible.)
Replies
1
Boosts
0
Views
984
Activity
Jul ’23
Delay when posting Local notification on Apple Watch
Hi! I have some trouble with local notification delivery on Apple Watch. It can take more than 1 minute to see the first local notification delivered. I made sure to not use a trigger so the notification will be delivered right away possible as specified in the UNNotificationRequest initializer doc. But there is always a delay for notification delivery. Here is how I'm creating the local notification: content.title = "title" content.subtitle = "subtitle" content.body = "body" content.userInfo = "userInfo" content.categoryIdentifier = "categoryIdentifier" content.threadIdentifier = "threadIdentifier" content.sound = UNNotificationSound.default let notifyRequest = UNNotificationRequest(identifier: stringWithUUID(), content: content, trigger: nil) let center = UNUserNotificationCenter.current() center.add(notifyRequest) { ( error: Error?) in if let theError = error { print(theError.localizedDescription) } else { print("Scheduled OK") } } Do you have any idea how to avoid the delay? Best!
Replies
0
Boosts
0
Views
808
Activity
Jul ’23
nextTriggerDate() inaccurate for UNTimeIntervalNotificationTrigger
UNTimeIntervalNotificationTrigger nextTriggerDate() is not accurate. It returns current date plus TimeInterval not what the next date the notification triggers.
Replies
0
Boosts
1
Views
601
Activity
Jul ’23
Feature request
As I sit here on the fourth hour waiting for Xcode to install. Can’t help, but think it would be nice if there was a way for notifications to be sent to my phone when applications on my computer have finished downloading, or installing
Replies
0
Boosts
0
Views
796
Activity
Jul ’23
MY COMPUTER DOESN'T OPEN ANYMORE RESOLUME ARENA
HELLO! I just bought a MacBook Pro M2 32g ssd 1t Ram thinking I had the best machine to work with videos and video's programs. I'm a visual artist, I use Resolume Arena and when I moved on the new computer my program, it starts to crash! I tried several times to install-uninstall the program and I don't know why is making that. This is what appears: Translated Report (Full Report Below) Process: Arena [935] Path: /Applications/Resolume Arena 6/Arena.app/Contents/MacOS/Arena Identifier: com.resolume.arena Version: 6.1.5 (6.1.5.68469) Code Type: X86-64 (Translated) Parent Process: launchd [1] User ID: 501 Date/Time: 2023-06-30 06:26:25.5102 +0200 OS Version: macOS 13.4 (22F66) Report Version: 12 Anonymous UUID: BBEB6B45-F295-0C98-2890-2A64E6E53977 Sleep/Wake UUID: AD36FAD9-7084-4522-9FA0-015CEAC0ABA5 Time Awake Since Boot: 230 seconds Time Since Wake: 12 seconds System Integrity Protection: enabled Crashed Thread: 9 Exception Type: EXC_ARITHMETIC (SIGFPE) Exception Codes: 0x0000000000000001, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 8 Floating point exception: 8 Terminating Process: exc handler [935] Thread 0:: Juce Message Thread Dispatch queue: com.apple.main-thread 0 ??? 0x7ff8909e69a8 ??? 1 libsystem_kernel.dylib 0x7ff800da6fbe __semwait_signal + 10 2 libsystem_c.dylib 0x7ff800c99585 nanosleep + 196 3 Arena 0x1051a4369 0x104c11000 + 5845865 4 Arena 0x1051a3c9e 0x104c11000 + 5844126 5 Arena 0x105119e60 0x104c11000 + 5279328 6 Arena 0x105119b85 0x104c11000 + 5278597 7 Arena 0x105111c87 0x104c11000 + 5246087 8 Arena 0x1055e7406 0x104c11000 + 10314758 9 Arena 0x1055e6c5c 0x104c11000 + 10312796 10 Arena 0x1055e6323 0x104c11000 + 10310435 11 Arena 0x105398455 0x104c11000 + 7894101 12 Arena 0x1058d289e 0x104c11000 + 13375646 13 Arena 0x105736756 0x104c11000 + 11687766 14 Arena 0x1051ed004 0x104c11000 + 6144004 15 Arena 0x1052dc7e1 0x104c11000 + 7124961 16 Arena 0x1051ecf14 0x104c11000 + 6143764 17 Arena 0x1051eceaf 0x104c11000 + 6143663 18 dyld 0x2067d841f start + 1903 Thread 1:: com.apple.rosetta.exceptionserver 0 runtime 0x7ff7ffdb0694 0x7ff7ffdac000 + 18068 Thread 2: 0 runtime 0x7ff7ffdce87c 0x7ff7ffdac000 + 141436 Thread 3: 0 runtime 0x7ff7ffdce87c 0x7ff7ffdac000 + 141436 Thread 4: 0 runtime 0x7ff7ffdce87c 0x7ff7ffdac000 + 141436 Thread 5: 0 ??? 0x7ff8909e69a8 ??? 1 libsystem_kernel.dylib 0x7ff800da70ee __psynch_cvwait + 10 2 libsystem_pthread.dylib 0x7ff800de3758 _pthread_cond_wait + 1242 3 Arena 0x1050707dc 0x104c11000 + 4585436 4 Arena 0x104fd5afe 0x104c11000 + 3951358 5 Arena 0x105075907 0x104c11000 + 4606215 6 libsystem_pthread.dylib 0x7ff800de31d3 _pthread_start + 125 7 libsystem_pthread.dylib 0x7ff800ddebd3 thread_start + 15
Replies
0
Boosts
1
Views
1.4k
Activity
Jun ’23
Banner of local notification from broadcast upload extension may not work.
Hi. I implemented a broadcast upload extension and it requests local notifications. The local notification works normally on broadcastStarted(withSetupInfo:), but the Banner of the local notification does not work on processSampleBuffer(_: with:) though its Notification Center works normally. What am I missing? Here is my code snippets. container app class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. requestAuthorization() ... } private func requestAuthorization() { let center = UNUserNotificationCenter.current() center.requestAuthorization(options: [.alert]) { granted, error in if let error = error { // Handle the error here. print(error) } if granted == true { center.delegate = self center.getNotificationSettings(completionHandler: { setting in print(setting) }) } else { print("not permitted") } } } } upload extension class SampleHandler: RPBroadcastSampleHandler { override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) { super.broadcastStarted(withSetupInfo: setupInfo) notification(title: "Upload Extension", body: "broadcastStarted") ... } override func processSampleBuffer(_ sampleBuffer: CMSampleBuffer, with sampleBufferType: RPSampleBufferType) { super.processSampleBuffer(sampleBuffer, with: sampleBufferType) ... if some condition { notification(title: "Upload Extension", body: "processSampleBuffer") } } private func notification(title: String, body: String) { let content = UNMutableNotificationContent() content.title = title content.body = body let request = UNNotificationRequest(identifier: UUID().uuidString, content: content, trigger: nil) let notificationCenter = UNUserNotificationCenter.current() notificationCenter.add(request) { error in if error != nil { print(error) } } } }
Replies
3
Boosts
0
Views
2.6k
Activity
Jun ’23
Xcode14.3.1 ; Cannot receive notification messages in debug mode
1.The phone cannot receive notification messages in debug mode , Xcode14.3.1; 2. Archive->Development->ipa ,Can receive notification messages How do you solve this problem?
Replies
0
Boosts
0
Views
844
Activity
Jun ’23
iPhone: All notifications from my app disappeared after a new notification arrived
lately, we found out that all notifications from the app I developed suddenly vanished for no reason when a new notification arrived. Mostly this case happened on iOS 16, and the notification has threadID by which we want to fulfill the notification grouping. When I continuously sent 4-5 notifications to my iPhone this case will happen. Problem screen recording did anyone encounter this situation? Why and how to fix it
Replies
0
Boosts
0
Views
661
Activity
Jun ’23
How to wake up app in background
Team, is there anyway, if we can wakeup the app while it is in suspended mode. I am using BLE scanning to share/receive the TCN token and generate notifications, but while app in sleep/suspended mode it stops. is there anyway to trigger this scanning or wake up the app without any manual intervention. we are trying to achieve this with help of silent notifications. can you help to figure out how many silent notification we can trigger in an hour ?
Replies
2
Boosts
0
Views
4.4k
Activity
May ’23
watchOS 9: ClockKit-based complications occasionally failed to display
Hello! Two of my watch apps (HiCoffee and HiWater) occasionally have issues with complications not displaying properly on watchOS 9. I did NOT use the new WidgetKit to implement the complications, all the related code still uses the same previous ClockKit + SwiftUI. I have observed several different types of wrong behaviors. One specific complication cannot be displayed (rendered?), while others do work (from the same app). This indicates that my watch app is working properly. All complications on the face cannot be displayed. But the app logs indicates it's running properly. In addition, when you long press the face to edit complications, yet it can be displayed normally. Log shows CLKComplicationServer.sharedInstance().activeComplications always returns 0 no matter how many complications are added to the face. Also, the ComplicationController is NOT called by system. I'm not using WatchKit. This part of the code in my app has been working properly for a long time and has not been changed. But after the release of watchOS 9, I received a lot of feedback from users with this problem. So I think the problem is in watchOS 9. I haven't found a way to reproduce the problem yet. Any suggestions please?
Replies
7
Boosts
2
Views
2.9k
Activity
May ’23
Debug Wrapper around NotificationCenter
I've been struggling with writing some dependency injection types for Foundation types like NotificationCenter, UIDevice, etc. I've created a sample package to demonstrate: https://github.com/MFB-Technologies-Inc/notification-center-client-demo. The goal is to mimic NotificationCenter's Publisher and notifications AsyncSequence. LiveNotificationCenterClientTests.testStream will fail unless it's run in isolation. If more than one test is run, it will never complete because no values are ever received from the stream. MockNotificationCenterClientTests.testPublisher fails because the expectations are not fulfilled before the timeout. For whatever reason, the published values are not being received in the sink. MockNotificationCenterClientTests.testStream never completes because the value is being endlessly awaited. It seems that there are some fundamental things about concurrency that I'm getting wrong. Can anybody help me debug this? For the two stream tests, I know I could rewrite them to fail with a timeout like the publisher tests but that's not the real problem.
Replies
0
Boosts
0
Views
937
Activity
May ’23
WatchOS Notifications Firing Late
We have a watchos app that uses notifications to display time sensitive information to the users. We are using UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false), our usernotification center looks like this func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { print("It got here to showing the notifications and this is when it is shown: \(Date()) and this is the type of notification: \(notification.request.identifier)") completionHandler([ .list, .sound, .banner ]) }. The problem is that the usernotification center is called correctly but no notification is given, every time 13 seconds later it is called twice again and only then does the notification display to the users. I have tried changing the type of trigger for the notification but even that did not get rid of the thirteen second delay.
Replies
1
Boosts
0
Views
859
Activity
May ’23