gpt4 book ai didi

android - FirebaseInstanceId : background sync failed: SERVICE_NOT_AVAILABLE

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:02:00 25 4
gpt4 key购买 nike

我正在使用本教程使用 Firebase 实现推送通知,但我似乎无法弄明白。一直报错:

FirebaseInstanceId: background sync failed: SERVICE_NOT_AVAILABLE, retry in 40s

我创建了一个扩展 FirebaseMessagingServiceonMessageReceived(..) 的类。我收到数据。我在 list 中注册了服务,例如:

 <!-- [START firebase_service] -->
<service android:name="notifications.MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- [END firebase_service] -->

我在应用程序的根文件夹中添加了最新的 google-services.json。不过,我什么也没记录。

自然地,我搜索了 StackOverflow 来检查类似的问题。显然不是很多。找到this , 但不是很有帮助,因为我仍然收到相同的消息。对我可能错过的事情有什么想法吗?

我尝试检查我的设备是否正在运行 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;
}

最佳答案

谢谢大家,我只需在手机的“设置”>“数据计划”中启用 Google Playstore 服务即可解决问题

关于android - FirebaseInstanceId : background sync failed: SERVICE_NOT_AVAILABLE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41739255/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com