Ste*_*mau 4 android firebase firebase-cloud-messaging
我正在使用本教程使用Firebase实现推送通知,但我似乎无法弄明白.继续抛出错误:
FirebaseInstanceId: background sync failed: SERVICE_NOT_AVAILABLE, retry in 40s
Run Code Online (Sandbox Code Playgroud)
我创建了一个类扩展FirebaseMessagingService
和onMessageReceived(..)
.我收到了数据.我在清单中注册了服务,如:
<!-- [START firebase_service] -->
<service android:name="notifications.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- [END firebase_service] -->
Run Code Online (Sandbox Code Playgroud)
我在我的应用的根文件夹中添加了最新的google-services.json.不过,我什么也没记录.
当然,我搜索到StackOverflow来检查类似的问题.显然,并不多.找到了这个,但是由于我仍然收到相同的消息,因此不是很有帮助.对我可能错过的事情的任何想法?
我试过检查我的设备是否运行PlayStore服务,确实它有:
public boolean isGooglePlayServicesAvailable() {
GoogleApiAvailability googleApiAvailability = GoogleApiAvailability.getInstance();
int status = googleApiAvailability.isGooglePlayServicesAvailable(getApplicationContext());
if (status != ConnectionResult.SUCCESS) {
if (googleApiAvailability.isUserResolvableError(status)) {
googleApiAvailability.getErrorDialog(MainActivity.this, status, 2404).show();
}
return false;
}
return true;
}
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
10748 次 |
最近记录: |