Firebase cloud messaging notification not received by device

前端 未结 20 1989
栀梦
栀梦 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: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`.

提交回复
热议问题