Skip to content

Setting com.onesignal.NotificationOpened.DEFAULT to DISABLE does not prevent app from resuming when app is backgrounded #1366

@jkasten2

Description

@jkasten2

Description:
Per the OneSignal "Changing the open action of a notification" documentation auto launching your app can be prevented by adding the following to your AndroidManifest.xml:

<meta-data android:name="com.onesignal.NotificationOpened.DEFAULT" android:value="DISABLE" />

This works to prevent the app from launching the main Activity if the app is cold starting. However if the is still in the background it is resumed. This is inconsistent and it should not resume in this case.

Environment

  • OneSignal-Android-SDK 4.4.0
    • Issue is most likely present back to 4.0.0, internally OneSignal switched to using an Activity from a BroadcastReceiver previously.
  • Confirmed the issue on Android 10 and 11

Steps to Reproduce Issue:

  1. Add the OneSignal SDK to your project
  2. Follow the "Changing the open action of a notification" guide.
  3. Send a push.
  4. Background the app
  5. Tap on the notification
  6. App is resumed.
    • However it should NOT due to disabling this auto behavior on step 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions