capacitor-background-runner icon indicating copy to clipboard operation
capacitor-background-runner copied to clipboard

Android actionTypeId action support

Open hahagu opened this issue 10 months ago • 1 comments

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.

hahagu avatar Jan 24 '25 12:01 hahagu

🦋 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

changeset-bot[bot] avatar Jan 24 '25 12:01 changeset-bot[bot]

@theproducer

Could you review this & merge it? Opening the app when a notification is clicked is a standard feature.

andrei0x309 avatar Aug 15 '25 23:08 andrei0x309