ionic-team / capacitor-background-runner

Other
33 stars 17 forks source link

Unable to dispatchEvent on android #76

Open martinglover opened 2 months ago

martinglover commented 2 months ago

I am trying to dispatch an event on receiving a notification while the app is closed.

On iOS this is demonstrated by adding BackgroundRunnerPlugin.dispatchEvent(event: "remoteNotification", eventArgs: userInfo) to the AppDelegate on didReceiveRemoteNotification

How is this achieved on android?

orioncx commented 2 months ago

Same problem. I believe steps is extend FirebaseMessagingService, then override onMessageReceived, and then....what? May be need to call BackgroundRunnerPlugin.dispatchEvent somehow but it does not provide any static methods