Post

Replies

Boosts

Views

Activity

Reply to Is it possible to detect a system alert popping up?
Found it! When a system alert POP UP, then the function will be called [AppDelegate applicationWillResignActive:], after dismiss the alert then [AppDelegate applicationDidBecomeActive:] will be called. So, it can be detected by add a observer for notifications named UIApplicationDidBecomeActiveNotification and UIApplicationWillResignActiveNotification, such as [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(observeUIApplicationDidBecomeActiveNotification) name:UIApplicationDidBecomeActiveNotification object:nil];       [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(observeUIApplicationWillResignActiveNotification) name:UIApplicationWillResignActiveNotification object:nil];
Jan ’23
Reply to Could Widget receive remote notifications
Through research and investigation, the Notification Service Extension can receive remote notifications except silent notifications or those that only play a sound or badge the app’s icon by invoking - (void)didReceiveNotificationRequest:(UNNotificationRequest *)request withContentHandler:(void (^)(UNNotificationContent *contentToDeliver))contentHandler
Feb ’23
Reply to Create Matter Binding
https://developer.apple.com/apple-home/matter/ https://developer.apple.com/documentation/mattersupport/adding-matter-support-to-your-ecosystem Firstly, commission into apple ecosystem then in matter extension override func commissionDevice(in home: MatterAddDeviceRequest.Home?, onboardingPayload: String, commissioningID: UUID) async throws {} get payload to commission into your ecosystem.
Dec ’23
Reply to Debugging WidgetKit install error "Failed to get descriptors for extensionBundleID"
Same issue. It always happens when new Xcode version and you haven't change the default deployment os version is target build General settings I found it may happens for many reasons, here will be one. Extension target version is higher than running device.(Minimum deployment version) For example , target setting 17.2 but running OS is 17.0 then it will fail for installing("Failed to get descriptors for extensionBundleID") Change to your supported minimum version or the running device that is satisfy the minimum version. Here my device is 17.0, I change the Minimum Deployments to 17.0 then running again success.
Dec ’23
Reply to [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone on iPad???
Same crash on widget Hardware Model: iPhone13,3 OS Version: iPhone OS 17.3 (21D50) Exception Type: EXC_CRASH (SIGABRT) Termination Reason: OBJC 1 call stack: 0 libsystem_kernel.dylib 0x00000001fc0c9bf8 __ulock_wait + 8 (:-1) 1 libdispatch.dylib 0x00000001bc962cf0 _dlock_wait + 56 (lock.c:326) 2 libdispatch.dylib 0x00000001bc962c20 _dispatch_once_wait + 112 (lock.c:679) 3 UIKitCore 0x00000001b6d7fb04 -[_UIApplicationConfigurationLoader _loadInitializationContext] + 164 (_UIApplicationConfigurationLoader.m:107) 4 UIKitCore 0x00000001b6d26f00 -[_UIApplicationConfigurationLoader applicationInitializationContext] + 24 (_UIApplicationConfigurationLoader.m:169) 5 UIKitCore 0x00000001b6dca77c -[_UIDeviceInitialDeviceConfigurationLoader initialDeviceContext] + 92 (_UIDeviceInitialDeviceConfigurationLoader.m:70) 6 UIKitCore 0x00000001b6e91c90 ___UIDeviceNativeUserInterfaceIdiom_block_invoke + 60 (UIDevice.m:752) 7 libdispatch.dylib 0x00000001bc962300 _dispatch_client_callout + 20 (object.m:561) 8 libdispatch.dylib 0x00000001bc963b3c _dispatch_once_callout + 32 (once.c:52) 9 UIKitCore 0x00000001b75c299c __initializeActiveUserInterfaceIdiom_block_invoke + 72 (UIDevice.m:1220) 10 libdispatch.dylib 0x00000001bc962300 _dispatch_client_callout + 20 (object.m:561) 11 libdispatch.dylib 0x00000001bc963b3c _dispatch_once_callout + 32 (once.c:52) 12 UIKitCore 0x00000001b6c1b150 -[UIDevice userInterfaceIdiom] + 64 (UIDevice.m:1232)
Feb ’24