capacitor-background-runner
capacitor-background-runner copied to clipboard
Android actionTypeId action support
This commit fixes https://github.com/ionic-team/capacitor-background-runner/issues/53
Additionally, it checks for actionTypeId and checks if an intent filter with action name of the actionTypeId exists, and runs it.
It can be used by adding the following to AndroidManifest.xml
<intent-filter>
<action android:name=".NOTIFICATION_CLICKED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
and the listener as such:
BackgroundRunner.addListener(
"backgroundRunnerNotificationReceived",
async (event) => {
console.log("Notification action performed:", event);
if (event.actionTypeId === "TEST_ACTION") {
alert("TEST_ACTION");
}
},
);
This is currently only implemented for Android.
🦋 Changeset detected
Latest commit: b90db7d3fa3abb1a275826faf292bc43f1c4715e
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 2 packages
| Name | Type |
|---|---|
| @capacitor/background-runner | Minor |
| example-app | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
@theproducer
Could you review this & merge it? Opening the app when a notification is clicked is a standard feature.