2

I have implemented FCM as per documentation and it is working perfectly on android versions 4.4(Kitkat) and above and not working on 4.3(Jelly Bean) and below versions. As per FCM documentation it says the minimum version required is 4.0 with play services which I have. FCM is generating refresh token and when I use it to send message from my server or FCM console it is not working. Below is my Manifest entries for FCM.

Firebase documentation

     <service android:name=".service.RMFirebaseInstanceIDService">
        <intent-filter>
            <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
        </intent-filter>
    </service>
    <service android:name=".service.RMFirebaseMessagingService">
        <intent-filter>
            <action android:name="com.google.firebase.MESSAGING_EVENT" />
        </intent-filter>
    </service>

Any suggestion is appreciated. Thanks.

4

1 回答 1

-1

使用最新的谷歌服务插件。

在顶级 build.gradle 中进行更改

buildscript {
// ...
dependencies {
  // ...
  // Add the following line:
  classpath 'com.google.gms:google-services:4.2.0'  // Google Services plugin
}

}

allprojects {
// ...
repositories {
  // Check that you have the following line (if not, add it):
  google()  // Google's Maven repository
  // ...
}

}

在模块化级别 build.gradle 文件中进行更改

 // Add the following line to the bottom of the file:
 apply plugin: 'com.google.gms:google-services'  // Google Play services Gradle plugin
于 2019-03-15T04:36:13.113 回答