push notification - WatchKit handleActionWithIdentifier : forRemoteNotification is not called -
i have simple static interface apple watch notification follow:
and in pushnotificationpayload follow:
{ "aps": { "alert": { "body": "123you have new message", "title": "myapp" }, "category": "respond" }, "watchkit simulator actions": [ { "title": "view message", "identifier": "viewmsgbtn" } ], "customkey": "customkey" }
and implement method in interfacecontroller
- (void)handleactionwithidentifier:(nsstring *)identifier forremotenotification:(nsdictionary *)remotenotification { nslog(@"handling remote notification: %@ identifier: %@", remotenotification, identifier); // [self.lbtest settext:[nsstring stringwithformat:@"notification: %@",remotenotification.description]]; }
and run simulator notification:
the awakewithcontext method in interfacecontroller called, , after clicking view message button , loads apple watch app interface.
the willactivate method in interfacecontroller called. handleactionwithidentifier forremotenotification not called... idea?
i experiencing similar (in swift) realized had implemented
handleactionwithidentifier(identifier: string?, forremotenotification remotenotification: [nsobject : anyobject], withresponseinfo responseinfo: [nsobject : anyobject])
instead of
handleactionwithidentifier(identifier: string?, forremotenotification remotenotification: [nsobject : anyobject])
the former cases user provides text response, not applicable here.
Comments
Post a Comment