Sometime tapping on notification's action button is not firing handleActionWithIdentifier: forLocalNotification:

Hi!


I am issuing a problem, which seams to be happen randomly. Usually tapping on notification action button on my notification's dynamic interface on watch fires this on my watch's delegate:


- (void) handleActionWithIdentifier: (NSString*) identifier
    forLocalNotification: (UILocalNotification*) localNotification {
     //handle action here..
}


But sometimes it is not fired with the following log:



Sep 29 13:22:13 MyWatch iap2d[177] <Warning>: process com.myapp.watchkitapp is now running in the background
Sep 29 13:22:13 MyWatch Carousel[30] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Sep 29 13:22:13 MyWatch Carousel[30] <Error>:  SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]
Sep 29 13:22:13 MyWatch Carousel[30] <Notice>: (Note ) log.facility.voicetrigger: ::: Received request to DISABLE voice trigger - Reason: Backlight turned on)
Sep 29 13:22:13 MyWatch iap2d[177] <Warning>: process com.myapp.watchkitapp is now running the foreground
Sep 29 13:22:13 MyWatch pkd[118] <Warning>: assigning plug-in com.myapp.watchkitapp.watchkitextension(3.8) to plugin sandbox
Sep 29 13:22:13 MyWatch pkd[118] <Warning>: enabling pid=92 for plug-in com.myapp.watchkitapp.watchkitextension(3.8) FCC2A72D-F729-4510-9260-85243A662516 /private/var/mobile/Containers/Bundle/Application/5E59D89D-55C6-4587-A120-7A3A8CC40051/MyApp.app/PlugIns/MyApp Extension.appex
Sep 29 13:22:14 MyWatch kernel[0] <Notice>: xpcproxy[188] Container: /private/var/mobile/Containers/Data/PluginKitPlugin/156E276A-CA06-4F9C-8D3C-AEED910F2ACD (sandbox)
Sep 29 13:22:14 MyWatch MyApp[187] <Warning>: Got notification url. Will pass notification ID "169571ac:e727747f:465214927.393453" and actionItemID "EXTEND_ACTION_IDENTIFIER" to app extension
Sep 29 13:22:15 MyWatch iap2d[177] <Warning>: process com.myapp.watchkitapp.watchkitextension is now running the foreground
Sep 29 13:22:15 MyWatch MyApp Extension[188] <Warning>: applicationDidFinishLaunching
Sep 29 13:22:15 MyWatch MyApp Extension[188] <Warning>: applicationDidBecomeActive
Sep 29 13:22:15 MyWatch MyApp Extension[188] <Notice>: (Error) WatchKit: ComF: -[SPRemoteInterface _interfaceControllerWithID:] interfaceController for interfaceControllerID:BB0002 not found (clientIdentifier=(null))
Sep 29 13:22:15 MyWatch MyApp Extension[188] <Notice>: (Error) WatchKit: ComF: -[SPRemoteInterface _interfaceControllerWithID:] interfaceController for interfaceControllerID:BB0002 not found (clientIdentifier=(null))
Sep 29 13:22:15 MyWatch MyApp Extension[188] <Notice>: (Error) WatchKit: <SPRemoteInterface.m -[SPRemoteInterface _handleAction:forNotification:remoteNotificationContext:localNotification:handler:controller:]:2825> called but remoteNotification and localNotification are both nil. This shouldn't have happened
Sep 29 13:22:15 MyWatch MyApp Extension[188] <Warning>: splash awakeWithContext
Sep 29 13:22:15 MyWatch MyApp Extension[188] <Warning>: splash will activate
Sep 29 13:22:15 MyWatch MyApp Extension[188] <Warning>: *********** ERROR -[SPRemoteInterface _interfaceControllerClientIDForControllerID:] clientIdentifier for interfaceControllerID:(null) not found
Sep 29 13:22:15 MyWatch MyApp Extension[188] <Notice>: (Error) WatchKit: ComF:<-Plugin -[SPRemoteInterface didFinishHandlingActivity:] controller ID (null) (object:(null)) has no client identifier
Sep 29 13:22:23 MyWatch gizmoappd[92] <Error>: 0x1f21c000 -[ACXSocket invalidate]: shutdown on socket 5 returned Socket is not connected
Sep 29 13:22:23 MyWatch gizmoappd[92] <Notice>: 0x1f21c000 -[ACXInstallerReceiver _reset]: Resetting state



The main problem line seams to be:

(Error) WatchKit: <SPRemoteInterface.m -[SPRemoteInterface _handleAction:forNotification:remoteNotificationContext:localNotification:handler:controller:]:2825> called but remoteNotification and localNotification are both nil. This shouldn't have happened


But I have no idea, what is causing this. Is there someone else who has been experiencing the issue?

Replies

Yes, I too have been having this problem with iOS 9 and watchOS 1/watch OS 2. There is no pattern to when it fails to fire. This had worked rather well in iOS 8 and watchOS 1.

I also can't get this to work.


Neither handleActionWithIdentifier(_:forLocalNotification:) nor handleActionWithIdentifier(_:forLocalNotification:withResponseInfo:) ever get called after the user pushes an action.

I get the same error Watch 2.0.1 and iOS 9.1.

same problem here with iOS 9.2 and WatchOS 2.1 😟

I'm still seeing this issue myself. Has anyone filed a bug report? The more people that file bug reports, the quicker they're likely to get this fixed.


What I've done in the meantime, which isn't having a good effect on battery life, is when my app fires a local notification I start a background task (and end any previously started background task). This improves the success rate significantly, but not 100%.

I'm seeing the same issue. It's very difficult to troubleshoot as the issue is incredibly intermittent and most frequently happens when I'm away from XCode using my app as normal.

I found it usually happens if you let the iOS app go back into the suspended state after it's fired the local notification, but it can happen regardless of state too I've found.

Same here.

Worked fine in iOS 8. Started seeing issues with iOS 9.

Type of notification doesn't seem to matter much(dynamic vs static).

I tend to see it more often after my app has been backgrounded for a while(usually early morning).

Opened bug report 24135523

I have been experiencing the same when first launching the app by tapping on the notification, or if the app is not in memory and the notification is tapped.


I've consistently and reproducibly narrowed it down to this: If you tap the notification too quickly, it fails. If you wait a few seconds, it's fine.


I've filed rdar://25214443 on this.