Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Notifications sometimes don't work on android app in release mode, changed upon installation. #1348

Closed
Pazamozaurus opened this issue Mar 23, 2020 · 9 comments
Assignees
Labels

Comments

@Pazamozaurus
Copy link

Pazamozaurus commented Mar 23, 2020

I'm using react-native-push-notifications in my android app(android 10, Samsung galaxy s10).

I have a very weird problem, and that is sometimes I don't get any notifications in my released app (in the debug version it works great).
But the point is, it's not that sometimes I get the notifications and sometimes don't, but rather it depends on when I install my app.
It can be that after I install my app I won't get notifications at all, but after I delete it and re-install, it suddenly can get notifications again.

I really can't figure out what's going on and why deleting and re-installing the app suddenly makes it accept notifications (re-installation doesn't 100% help it to start get notifications, sometimes I need to install and re-install it a couple of times before I can get it.

My version of react native is 0.61.4 and version 3.1.9 of react-native-push-notification.

I'm not sure what kind of another info/configuration about my app I should point out, because I really have no clue what can cause such a phenomenon.
Just to clarify, all the other notifications in my phone work properly without any problems.

Other clarifications: I'm talking about remote notifications of course that I send through firebase

After some debugging I found out that indeed when the notifications don't work and I try to send a message to the token I receive on the onRegister function, I get a "NotRegistered" error from FCM.

But I really have no clue why the registration sometimes work and sometimes doesn't...

@Pazamozaurus Pazamozaurus changed the title Notifications sometimes doesn't work on android app in release mode, changed upon installation. Notifications sometimes don't work on android app in release mode, changed upon installation. Mar 23, 2020
@Dallas62
Copy link
Collaborator

Dallas62 commented Apr 9, 2020

Hi @Pazamozaurus,
Can you check if PR #1355 resolve your issue ?
Thanks

@Pazamozaurus
Copy link
Author

Hi @Dallas62
Eventually what solved my issue was that in my android/build.gradle file I had the following configuration

googlePlayServicesVersion = "+"
firebaseVersion = "+"
(As it appears in the usages example here).
In this configuration the notifications worked perfectly in debug mode and sometimes on release mode.

When I changed it to specific versions, like
googlePlayServicesVersion = "16.1.0"
firebaseVersion = "17.3.4"

It worked correctly on both debug and release mode. I'm not even sure if these are the correct versions of googlePlayServices and firebaseVersion I use, but at least for me it worked.

@Dallas62 Dallas62 self-assigned this Apr 9, 2020
@Dallas62
Copy link
Collaborator

Dallas62 commented Apr 9, 2020

Thanks for this feedback!
Since I may take some times to reproduce this issue, it would be great if you test a small change to your project.
Change the current version of react-native-push-notification:

    "react-native-push-notification": "git+https://github.com/jackw-kounta/react-native-push-notification.git"

then run:

yarn install

OR

npm install

This will allow you to test the PR.
Then if the PR fix this issue, I will be able to validate the PR to release it ;)
You will have to revert your following changes before test :

googlePlayServicesVersion = "16.1.0"
firebaseVersion = "17.3.4"

Thanks a lot!

@Dallas62
Copy link
Collaborator

The PR #1355 is merged into mater, and will be released ASAP.

@i1990jain
Copy link

I am also facing a similar issue, using version react-native-push-notification : ^3.1.9
do you suggest updating the package will solve the issue or should I try the above suggestion of changing the googlePlayServicesVersion and firebaseVersion ?

@github-actions
Copy link

github-actions bot commented Oct 8, 2021

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

@github-actions github-actions bot added the Stale label Oct 8, 2021
@github-actions github-actions bot closed this as completed Nov 7, 2021
@sravanpronteff
Copy link

same issue with 8.1.1 working fine in debug but not sending notification in release APK

@lucaszdev
Copy link

Same here, working very well in debug, and not sending notification in release APK

@lucaszdev
Copy link

same issue with 8.1.1 working fine in debug but not sending notification in release APK

Hey Buddy, I found the Resolution of the problem, you've to Sign your app?

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

No branches or pull requests

5 participants