Good morning, I have a problem with push notifications, I recently implemented a method for sending notifications and everything has worked very well in development, but when I uploaded the version to the play store it stopped working, starting with the fact that I did not get the input token then I tried to add the token manually and the notification was not sent, my implementation is simple, you can review my question in which I had a problem so you can see the work I have done so I don't make this question so long anymore! This is the question I asked earlier:
Push notifications on Android with Firebase using token
Well starting from this I have searched for information in many places and the best thing I have found is that I must add the sha-1 and sha-256 keys but this time Google Play Console
in the "integrity of the app" section however it has not worked for me, what else should i do? Is there something I'm forgetting?
I have already done these steps: I already got my sha 1 from Android
I also went to fetch the sha 1 from google play console
And finally add them in firebase along with your sha-256 (they appear more because I added some test
However, they do not work, the name of the package is the same, the json that I must add to Android also works, however it seems that in production there is something that is being done wrong?
I did a test getting the input device token on the home screen using the following code:
FirebaseInstanceId.getInstance().getInstanceId().addOnSuccessListener(Login.this, instanceIdResult -> {
token = instanceIdResult.getToken();
Log.i("FCM Token", token);
Toast.makeText(getApplicationContext(), "El token es "+token, Toast.LENGTH_SHORT).show();
});
As you can see, I have a toast that shows me the token but it doesn't even enter the toast, so I came to the conclusion that it is no longer this implementation of notifications, but rather that any service that I use in firebase does not work. I also did the test with SMS verification and it doesn't work either...
Something worth mentioning is that I don't know if google cloud platform has anything to do with all this? reviewing the google cloud platform console I realize that it has the option to activate the notifications API but despite the fact that I have activated it, it does not work either, nor do I know how the Google Cloud Platform has a connection with firebase but it is also another possible solution to the problem:
And that would be all honestly due to my little knowledge I have not the slightest idea what else I should do, I hope you can help me, if you need any code or have any questions do not hesitate to ask in advance thank you very much!!!
You need to add Release sha-1 from Google Play to Firebase. You can find the sha-1 on the Play Store web page under Setup -> App Integrity. Add the sha-1 to your Firebase project in Project Overview -> Settings. Then download the new google-service.json from Firebase and add it to your project. Then rebuild your app and upload it to Google Play. Notifications should work in this new version.