-
Notifications
You must be signed in to change notification settings - Fork 1.9k
IOS button action callbacks not getting called #576
Comments
In case it helps - here's a little more logging from one of my scenarios. I send 3 pushes and on each one I hit 'Accept' (the yes button). You can see from the logging that the push plugin gets the notification and sees the payload keys on every push, but my callbacks only get called sometimes. On the 1st push/Accept - the push plugin logs, but I do NOT see my callback logging. 1st Push logging2016-02-05 11:02:34.623 Mobile Auth[323:29939] Push Plugin handleActionWithIdentifier window.acceptVerification 2nd Push logging2016-02-05 11:02:52.914 Mobile Auth[323:29939] Push Plugin handleActionWithIdentifier window.acceptVerification 2016-02-05 11:03:16.190 Mobile Auth[323:29939] PushService: handle Accept Verification Button 3rd Push logging2016-02-05 11:03:16.195 Mobile Auth[323:29988] void SendDelegateMessage(NSInvocation *): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode |
This thread has been automatically locked. |
I have been using an earlier version of this plugin successfully for some time w/o action buttons.
But now I want to add action buttons and am having trouble getting the callbacks to work on IOS (I haven't tried Android yet).
I am able to see the buttons and click on them in the notification, but I am only sometimes getting into callbacks. The behavior does not seem to be the same every time, but I have seen where if I send push #1 and click on the yes button (and do NOT get into the yes callback), but then send push #2 and then click on the no button - then the yes callback finally gets called.
Also - if I continue in this vein, sending additional pushes and clicking back and forth between the yes and no buttons, it only takes a handful of pushes before I get this error as well:
void SendDelegateMessage(NSInvocation *): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode
I am using:
I have my callbacks defined like:
window.acceptVerification = function(data) {
console.log('PushService: handle Accept Verification Button');
console.log("ACCEPT DATA: " + JSON.stringify(data));
}
window.rejectVerification = function(data) {
console.log('PushService: handle Reject Verification Button');
console.log("REJECT DATA: " + JSON.stringify(data));
}
and my init config looks like:
config = {
"ios" : {
"badge": "true",
"clearBadge": "true",
"sound": "true",
"alert": "true",
"categories": {
"verification": {
"yes": {
"callback": "window.acceptVerification",
"title": "Accept",
"foreground": false,
"destructive": false
},
"no": {
"callback": "window.rejectVerification",
"title": "Reject",
"foreground": false,
"destructive": true
}
}
}
}
}
The text was updated successfully, but these errors were encountered: