Closed MohammedBashiru closed 4 years ago
I have no idea.. the plugin doesn't use endBackgroundTask
and I don't see you using or overriding the appdelegate in that snippet..
Yes. I taught as well. but removing this function resolves
registerForPushNotifications
without removing it. As soon as I accept or declines push permission. I see the log printed in terminal
console.log("End of background task.");
@EddyVerbruggen Please does the plugin fails to resolve when your app uses custom delegate? On further investigation it turns out that once I enable custom delegate the plugin fails to resolve
registerForPushNotifications
If you simply override the app delegate with your own then yeah, registering for pushes fails.
Ok is there a work around for this ? Because am registering a custom delegate to use create background task.
Try and make them work together. One way may be to look at this dependency: https://github.com/EddyVerbruggen/nativescript-plugin-firebase/blob/6142ec1956165d08c2ef3d3995f58c5846a1bef4/src/package.json#L138
await messaging.registerForPushNotifications({ ...options })
calling the above method does not resolve if you approve or reject push notification permission.
I found the issue to be my custom delegate overriding whatever callback function the plugin is expected to call.
this method in my custom delegate is the problem. If I comment it out, the plugin resolves.
@EddyVerbruggen Please any work around for this ? as I need my custom delegate for a background task.