Android: FCM java.io.IOException: SERVICE_NOT_AVAILABLE error on some devices(Android:FCM java.io.IOException:某些设备上的 SERVICE_NOT_AVAILABLE 错误)
问题描述
我在我的项目中使用 FCM
它可以在 Sony xperia、Galaxy S6、摩托罗拉等设备上正常工作.但是在 Galaxy S3 上我得到 java.io.IOException: SERVICE_NOT_AVAILABLE 错误
It work correct on Sony xperia, Galaxy S6, Motorola and more. But on Galaxy S3 i get java.io.IOException: SERVICE_NOT_AVAILABLE error
Galaxy S3 自动计时,google play 更新
Time of Galaxy S3 is auto and google play is updated
互联网连接很好,我连接到没有代理的开放互联网
Internet connection is strong and i connected to open internet without proxy
推荐答案
当设备无法注册到 Firebase 时会出现此错误.确保调用此代码时互联网正常工作.并将代码放入 try-catch 以防止应用崩溃.
This error is caused when the device is unable to register to Firebase. Make sure the internet is working when this code is called. And put the code within try-catch to stop app from crashing.
在注册设备或获取令牌之前添加互联网连接检查.或者将 Fetch 令牌代码包装在 try-catch 块中,以防止应用崩溃.
Either add an internet connection check before registering the device or fetching token. Or wrap the Fetch token code in try-catch block to prevent app from crashing.
这篇关于Android:FCM java.io.IOException:某些设备上的 SERVICE_NOT_AVAILABLE 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android:FCM java.io.IOException:某些设备上的 SERVICE_NOT_AVAILABLE 错误
基础教程推荐
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- iOS4 创建后台定时器 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
