Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pinpoint notifications not opening app targeting Android 12 #2762

Closed
cirion opened this issue Jan 6, 2022 · 5 comments · Fixed by #2925
Closed

Pinpoint notifications not opening app targeting Android 12 #2762

cirion opened this issue Jan 6, 2022 · 5 comments · Fixed by #2925
Assignees
Labels
bug Something isn't working pinpoint Issues with the AWS Android SDK for Pinpoint.

Comments

@cirion
Copy link

cirion commented Jan 6, 2022

Describe the bug
When targeting Android SDK 31, notifications appear successfully, but tapping them just dismisses the notification without opening the app.

To Reproduce

Set up push notifications as described in the docs.

Set the app targetSdk 31.

Send a push notification to the device, configured to open the app or a URL.

Tap on the push notification.

Which AWS service(s) are affected?

Pinpoint notifications for Android.

Expected behavior
Tapping the notification should open the app, deeplink, or URL set in the notification.

Environment Information (please complete the following information):

  • AWS Android SDK Version: 2.37.1
  • Device: Various, including Pixel 6
  • Android Version: 12 / API 31
  • Specific to simulators: No

Additional context

Opening the app from a notification works fine with the targetSdk set to 30.

The relevant part of the log seems to be the following:

I/ActivityTaskManager: START u0 {act=android.intent.action.VIEW dat=https://example.com/... flg=0x10000000 cmp=org.mozilla.firefox/org.mozilla.fenix.IntentReceiverActivity} from uid 10335
E/NotificationService: Indirect notification activity start (trampoline) from com.example.android.debug blocked
W/ActivityTaskManager: Background activity start [callingPackage: com.example.android.debug; callingUid: 10335; appSwitchAllowed: true; isCallingUidForeground: false; callingUidHasAnyVisibleWindow: false; callingUidProcState: RECEIVER; isCallingUidPersistentSystemProcess: false; realCallingUid: 10335; isRealCallingUidForeground: false; realCallingUidHasAnyVisibleWindow: false; realCallingUidProcState: RECEIVER; isRealCallingUidPersistentSystemProcess: false; originatingPendingIntent: null; allowBackgroundActivityStart: false; intent: Intent { act=android.intent.action.VIEW dat=https://example.com/... flg=0x10000000 cmp=org.mozilla.firefox/org.mozilla.fenix.IntentReceiverActivity }; callerApp: ProcessRecord{efeb5fb 28572:com.example.android.debug/u0a335}; inVisibleTask: false]
E/ActivityTaskManager: Abort background activity starts from 10335

This seems to be related to a change in Android 12 to disallow starting activities from services or receivers that were opened by a notification.

@cirion cirion changed the title Pinpoint notifications not opening app on Android 12 Pinpoint notifications not opening app targeting Android 12 Jan 6, 2022
@tjleing
Copy link
Contributor

tjleing commented Jan 19, 2022

I was able to reproduce this issue. Looks like @sktimalsina updated the PendingIntent code on showing the notification, but actually processing opening the notification was not updated yet. As mentioned in #2326 a fix for this might end up fixing both.

@tjleing tjleing self-assigned this Jan 19, 2022
@tjleing tjleing added bug Something isn't working pinpoint Issues with the AWS Android SDK for Pinpoint. labels Jan 19, 2022
@sokarcreative
Copy link

Any news ? I have the same problem too.

@mattlenehan
Copy link

🙋‍♂️ I'm having this problem too, please help 🙏

@nzayatz14
Copy link

nzayatz14 commented Feb 10, 2022

@tjleing I also am having this issue on 2.40.0

As far as I can tell the changes need to be made to the PinpointNotificationReceiver.

This is a pretty good tutorial I found for updating this: (https://proandroiddev.com/notification-trampoline-restrictions-android12-7d2a8b15bbe2)

@tylerjroach
Copy link
Contributor

This issue has been resolved and is live in v2.48.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pinpoint Issues with the AWS Android SDK for Pinpoint.
Projects
None yet
6 participants