1

Steps:

Result:

  • Activity does not start.
  • Following log is printed in Logcat

10-06 10:18:22.977 1534 3091 E NotificationService: Indirect notification activity start (trampoline) from com.example.app blocked


By rewriting following code

builder.setContentIntent(
          NotificationManager.redirectIntentForAnalytics(
            context,
            PendingIntent.getActivity(
              context,
              Random().nextInt(),
              Intent(context, MainActivity::class.java),
              PendingIntent.FLAG_UPDATE_CURRENT
            ),
            notificationMessage,
            true
          )
        )

with

builder.setContentIntent(
          PendingIntent.getActivity(
              context,
              Random().nextInt(),
              Intent(context, MainActivity::class.java),
              PendingIntent.FLAG_UPDATE_CURRENT
          )
        )

the app is launches correctly.

I think this problem is related to https://developer.android.com/about/versions/12/behavior-changes-12?hl=en#notification-trampolines

How to fix this problem?

4
  • Thank you. Researching.
    – Bill Mote
    Commented Oct 6, 2021 at 11:43
  • An immediate fix, obviously, would be to temporarily eliminate the redirectForAnalytics() wrapper of the PendingIntent, but this will affect the open analytics reported for the messages. We're looking into a solution.
    – Bill Mote
    Commented Oct 6, 2021 at 11:49
  • Alternatively, you could target Android 30 which would work as-is today while we prepare a fix.
    – Bill Mote
    Commented Oct 6, 2021 at 13:12
  • 1
    I'm going to leave targetSdkVersion at 30 until this issue is fixed. Thank you.
    – virifi
    Commented Oct 6, 2021 at 23:26

1 Answer 1

1

Please update to version 8.0.1 which has been released to address this issue.

2
  • 1
    I confirmed that the issue has been fixed on version 8.0.1. Thank you.
    – virifi
    Commented Oct 15, 2021 at 0:23
  • 1
    @Bill Mote ,Thank you very much! I am having a similar issue when using Firebase Messaging. Upgrading Firebase to the latest version should resolve the problem.
    – 石秀文
    Commented Feb 14, 2023 at 8:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .