Skip to content

Fix for Android trampoline restriction #920

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

Merged
merged 1 commit into from
May 18, 2023

Conversation

ravirajn22
Copy link
Contributor

When targeting Android 31, we cannot use a Service to start an Activity. So instead of using PendingIntent to start a Service we start an Activity directly.

Old flow
Set PendingIntent for notification -> On press -> Start Service -> Start Activity if not visible

New flow
Set PendingIntent for notification -> On press -> Start Activity

We already subscribe to Activity lifecycle event like created and onNewIntent, we use this callbacks to fire notification opened to JS.

I have tested the basic cases and its working fine.
I want others to test against their cases and tell if Its working fine in those cases.

@stale
Copy link

stale bot commented Jan 15, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale label Jan 15, 2023
@FilDevTronic
Copy link

Any updates on this from maintainers? My team is encountering the same issue - thank you for submitting this change @ravirajn22, we're testing it now.

@stale stale bot removed the 🏚 stale label Feb 2, 2023
@b3itgustaf
Copy link

Have you gotten around to taking a look at this PR @DanielEliraz ? This is currently a major blocker in our application since we're targeting SDK 31 and at the moment all notifications are discarded when tapping them instead of opening the app, because of this.

@ravirajn22 have you considered forking this repo until the code owners have had time reviewing this PR?

@b3itgustaf
Copy link

@DanielEliraz Is this repo abandoned? This PR is fixing a major issue in the library, and w/o this fix our project need to check in to another solution.

@stale
Copy link

stale bot commented May 12, 2023

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🏚 stale label May 12, 2023
@DanielEliraz DanielEliraz merged commit 63ec3ca into wix:master May 18, 2023
DanielEliraz added a commit that referenced this pull request May 18, 2023
This reverts commit 63ec3ca.
DanielEliraz added a commit that referenced this pull request May 22, 2023
* Revert "Init (#920)"

This reverts commit 63ec3ca.

* fix-ios-test

* remove jenkins leftovers

* bump iphone

* enlarge java heap
@TwistedMinda
Copy link

I'm still having the issue :(

Tapping on android notification where application is in foreground doesn't pass the Intent through

@ovbm
Copy link

ovbm commented Sep 14, 2023

I'm still having the issue :(

Tapping on android notification where application is in foreground doesn't pass the Intent through

Adding this version of firebase fixed the issue for us: republik/app@2ca29d4

@TwistedMinda
Copy link

TwistedMinda commented Sep 14, 2023

@ovbm Thanks for your help however it doesn't change anything on my side.
Just to be sure that we are on the same bug:
Tapping a notification:

  • opens correctly when app is on background
  • opens correctly when app is quitted
  • opens by restarting the activity when app is on foreground

The activity doesn't seem to really restart entirely: SplashScreen appears but the navigation state is preserved.
It would still be okay if getInitialNotification() would return the notification tapped, but it's not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants