Android firebasemessagingservice не стартует

Android (sdk 26) Firebase messaging is not working #487

Comments

DenLangeKilde commented May 4, 2018 •

I have been trying to implement Firebase messaging in my app for a while now. I have followed different kinds of tutorial, including the official one by Firebase, adding it both manually and automatic with Firebase Assistant.

For some reason, the following statements are true:

  • onTokenRefresh() in the class extending FirebaseInstanceIdService, is
    NEVER called.
  • onMessageReceived(remoteMessage: RemoteMessage?) in the
    class extending FirebaseInstanceIdService, is NEVER called.
  • No messages are received on

MyFirebaseInstanceIDService:

MyFirebaseMessagingService

I have added the following to my Manifest:

(Note that I have tried setting exported to true and false and also with and without the metatag for setting the channel)

I have also added the following to my Application class:

Apparently this was required when I tried to use the method «getToken()» through Firebase. A have also tried with and without these methods.

In my main activity I have tried placing the «getToken()» method through Firebase to attempt to trigger the initialization of the token, but still without any luck.

I have of course added the messaging library to my app module gradle:

And these to my project gradle:

When sending the messages through the Firebase dashboard I have tried:

  • Entering the channel
  • Setting target as User segment
  • Setting target as Single device (the token from the app)
  • .
Читайте также:  Filter provider android что это

I have also tried things like:

  • uninstalling and reinstalling the app whenever I tried a new approach
  • deleting instanceid and calling getToken again
  • Trying in both debug and non-debug mode
  • .

Here is how my list of send messages looks like in the dashboard:

If any more details are needed, please let me know and I will of course supply them (if possible).

Any help will be greatly appreciated.

The text was updated successfully, but these errors were encountered:

phuoc1993 commented May 9, 2018

Nik2505 commented May 18, 2018

try with latest Firebase Messaging service :

bigant88 commented Sep 6, 2018

I got the same issue, firebase does not work

DenLangeKilde commented Sep 6, 2018 •

I forgot all about this issue. But eventually, I figured it out by myself.

What solved it for me, was to remove the following from my manifest:

If I remember correctly, the above lines were used to override the appearance of the incoming push messages etc. This was originally implemented by a previous developer on my project and it was a coincidence that I discovered this.

@bigant88 Try and see if you have any of the above lines in your manifest. If not, try investigating further to see if you have some other configurations, that overrides anything related to push notifications.
Best of luck to you

I will close this issue now, as my problem described above is solved .

Источник

Оцените статью