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

Fix for indirect notification activity start (trampoline) from blocked #2352

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fcaldarelli
Copy link

No description provided.

@ChrisNg02655332
Copy link

Any process on this PR? I am currently facing with this issue

@fcaldarelli
Copy link
Author

@ChrisNg02655332 if you Need urgently, use my fork package in meantime waiting for merge the pr

@kartik8Zapkey
Copy link

@ChrisNg02655332 if you Need urgently, use my fork package in meantime waiting for merge the pr

Still dont work it still says Indirect notification activity start (trampoline)

@netzon-zerxa
Copy link

This is also not working for me. It still gives me the same error message: "Indirect notification activity start (trampoline) from app blocked." 🥲

@fcaldarelli
Copy link
Author

@kartik8Zapkey have you tried changes in my fork?

@kartik8Zapkey
Copy link

@fc

@kartik8Zapkey have you tried changes in my fork?

Yes i tried your fork , but still dont work. is anyone here for whom it is working ??

@HirokiDaido
Copy link

@fcaldarelli
Your fork works fine in our project! Thank you!
master...fcaldarelli:react-native-push-notification:master

@azhagar-magilhub
Copy link

@fcaldarelli Your fork works fine in our project! Thank you! master...fcaldarelli:react-native-push-notification:master

how to pull this commit into my project

@siddhant-maurya
Copy link

We are blocked due to this error can someone please share any solutions

@Ainias
Copy link

Ainias commented Apr 25, 2023

This branch works, but the repo looks abandoned. I don't think it will be merged in soon.

I've created a pacth (usabale with patch-packe):

diff --git a/node_modules/react-native-push-notification/android/build.gradle b/node_modules/react-native-push-notification/android/build.gradle
index d6019f6..7022cd8 100644
--- a/node_modules/react-native-push-notification/android/build.gradle
+++ b/node_modules/react-native-push-notification/android/build.gradle
@@ -60,5 +60,6 @@ dependencies {
     implementation "$appCompatLibName:$supportLibVersion"
     implementation 'com.facebook.react:react-native:+'
     implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
-    implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '21.1.0')}"
+    implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '23.1.2')}"
+    implementation "com.google.firebase:firebase-iid:21.1.0"
 }

@Ben8823
Copy link

Ben8823 commented Jun 14, 2023

@fcaldarelli
I've merged your changes in my project, but I'm still getting this error on Anroid 13:
Indirect notification activity start (trampoline) from xxx blocked
Any ideas what could be wrong?

@fcaldarelli
Copy link
Author

@Ben8823 have you tried to clean e rebuild the project?

@Ben8823
Copy link

Ben8823 commented Jun 14, 2023

@fcaldarelli yes I did run a gradle clean

@fcaldarelli
Copy link
Author

@Ben8823 have you tried to link my repo as library: https://github.com/fcaldarelli/react-native-push-notification ?

@Ben8823
Copy link

Ben8823 commented Jun 14, 2023

@fcaldarelli yes I'm using this in my package.json:
"react-native-push-notification": "github:fcaldarelli/react-native-push-notification#c625b16e419631bc5c40d1df0919fb91162ac57"
I also can see the changes made to the build.gradle in my node_modules.

@Ben8823
Copy link

Ben8823 commented Jun 15, 2023

@fcaldarelli it turned out that the firebaseMessagingVersion was defined somewhere else in my project. removing that definition fixed the issue and your changes are working fine. thanks!

@mikmedina
Copy link

This branch works, but the repo looks abandoned. I don't think it will be merged in soon.

I've created a pacth (usabale with patch-packe):

diff --git a/node_modules/react-native-push-notification/android/build.gradle b/node_modules/react-native-push-notification/android/build.gradle
index d6019f6..7022cd8 100644
--- a/node_modules/react-native-push-notification/android/build.gradle
+++ b/node_modules/react-native-push-notification/android/build.gradle
@@ -60,5 +60,6 @@ dependencies {
     implementation "$appCompatLibName:$supportLibVersion"
     implementation 'com.facebook.react:react-native:+'
     implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
-    implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '21.1.0')}"
+    implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '23.1.2')}"
+    implementation "com.google.firebase:firebase-iid:21.1.0"
 }

This worked for me, notifications were showing up but clicking them doesn't open the app before.

@fcaldarelli
Copy link
Author

This branch works, but the repo looks abandoned. I don't think it will be merged in soon.
I've created a pacth (usabale with patch-packe):

diff --git a/node_modules/react-native-push-notification/android/build.gradle b/node_modules/react-native-push-notification/android/build.gradle
index d6019f6..7022cd8 100644
--- a/node_modules/react-native-push-notification/android/build.gradle
+++ b/node_modules/react-native-push-notification/android/build.gradle
@@ -60,5 +60,6 @@ dependencies {
     implementation "$appCompatLibName:$supportLibVersion"
     implementation 'com.facebook.react:react-native:+'
     implementation 'me.leolin:ShortcutBadger:1.1.22@aar'
-    implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '21.1.0')}"
+    implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '23.1.2')}"
+    implementation "com.google.firebase:firebase-iid:21.1.0"
 }

This worked for me, notifications were showing up but clicking them doesn't open the app before.

@mikmedina avoid to use patch in node_modules, because it does not works in CI/CD and everytime you need to download node_modules.

@ericowhadi
Copy link

facing the same issue, I tried to exactly like Ben8823 "react-native-push-notification": "github:fcaldarelli/react-native-push-notification#c625b16e419631bc5c40d1df0919fb91162ac57", ./gradlew clean, verify dependencies to see if any other package would force a different version of firebase-messaging. But no luck, still having that trampoline issue.
Anybody else facing this situation?

@ericowhadi
Copy link

after deep investigation, I have no clue why updating firebase would solve the issue. I can only intuit may be the target version of android that was used to validate it is working or not was under the threashold of the trampoline feature. On paper, when reading what this feature is, it should not be possible if you target an modern SDK that fall under the trampoline feature, to invokeApp or deeplink from the onAction in background task. That is the whole purpose of this feature -> forbid us to do so. So google is asking that instead of doing trampoline (that's the way they call this action of defering the invokeApp via a background task, to directly configure the action to open a deepLink, bypassing the middleman, and therefore making the action more responsive.
So I patched the code in my fork to now allow passing actions with associated deepLink, syntax mybutton>com.mydeeplync://qwerty . If you don't use that syntax, the code behave as before (generates an onAction), so that you can have button that perform background task and does not need to invoke main app, or for buttons that needs to invoke main app, use that new syntax. BTW, I also included in my fork a fix to ReplyInput that is also broken in latest version of SDK that require MUTABLE flag to be set instead of IMMUTABLE. Note that ReplyInput only support legacy onAction generation, meaning you cannot use the deepLink feature with ReplyInput.
https://github.com/ericowhadi/react-native-push-notification/blob/master/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java

galkn added a commit to galkn/react-native-push-notification that referenced this pull request May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet