I have a simple static interface for notifying Apple watches:

and in PushNotificationPayload:
{
"aps": {
"alert": {
"body": "123You have a new message",
"title": "myApp"
},
"category": "respond"
},
"WatchKit Simulator Actions": [
{
"title": "View Message",
"identifier": "viewMsgBtn"
}
],
"customKey": "customKey"
}
and implement the method in InterfaceController
- (void)handleActionWithIdentifier:(NSString *)identifier
forRemoteNotification:(NSDictionary *)remoteNotification
{
NSLog(@"Handling remote notification: %@ with identifier: %@", remoteNotification, identifier);
}
and I run the simulator with a notification:

The awakeWithContext method is called in the InterfaceController and after clicking the "View message" button, and it is loaded into the apple watch application interface.
the willActivate method in the InterfaceController is called. but handleActionWithIdentifier forRemoteNotification is not called ... any idea?
source
share