Closed HugoHeneault closed 6 years ago
I'm confused why the event handler cordova.plugins.CordovaCall.on('answer')
is inside of your push notification handler. Nesting event handlers is generally not a good idea.
@D-Marc1 is right. Your code should look like this:
pushObject.on('notification').subscribe((data: any) => {
cordova.plugins.CordovaCall.receiveCall(data.additionalData.username);
});
cordova.plugins.CordovaCall.on('answer', () => {
this.handleDeeplink();
});
That being said, I do think that we should implement an off
method in a future release.
I'm receiving different calls by push notification, with different params for each of them:
As I'm setting the
CordovaCall.on('answer')
at every push reception, I need to unbind it before setting it again. But I don't think there is aoff()
method.Or maybe there is another way of handling it?
Thanks!