Firebase cloud messaging notification not received by device

前端 未结 20 1898
栀梦
栀梦 2020-11-28 23:58

I am having an issue with FireBase Cloud Messaging in which I get the Token from the device and send the notification test through the Google Firebase notification console h

相关标签:
20条回答
  • 2020-11-29 00:51

    google apis are to be honest full of sh*. They randomly dont work with no means of debugging

    0 讨论(0)
  • 2020-11-29 00:51

    If you have just added FCM to an existing app, onTokenRefresh() will NOT be called. I got it to run by uninstalling the app and installing it again.

    0 讨论(0)
  • 2020-11-29 00:52

    I've been working through this entire post and others as well as tutorial videos without being able to solve my problem of not receiving messages, the registration token however worked.

    Until then I had only been testing the app on the emulator. After trying it on a physical phone it instantly worked without any prior changes to the project.

    0 讨论(0)
  • 2020-11-29 00:53

    In my case, I just turn on WIFI and mobile data in the emulator and it works like a charm. cause I can't send comments, post a reply. Good luck

    0 讨论(0)
  • 2020-11-29 00:56

    I had this problem, I checked my code. I tried to fix everything that was mentioned here. lastly the problem was so stupid. My device's Sync was off. that was the only reason I wasn't receiving notifications as expected.

    0 讨论(0)
  • 2020-11-29 00:59

    I had a similar problem, but in my case I was missing the google-services plugin from my Gradle build (I was adding Firebase to an existing project).

    I added the following to my root build.gradle:

    classpath 'com.google.gms:google-services:3.1.0'
    

    and the following to the end of my app-level build.gradle:

    apply plugin: 'com.google.gms.google-services'
    

    I then had to download the google-services.json file from the Firebase Console (having originally imported an existing Google Cloud project) and copy it to my app directory`.

    0 讨论(0)
提交回复
热议问题