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 错误
- 使用自动布局向 UIScrollView 添加动态大小的视图 2022-01-01
- 如何在 iPhone 模拟器中重置 NSUserDefaults 数据? 2022-01-01
- GPS状态的广播接收器? 2022-01-01
- Xcode 7.3 中带有 UILabel 的 UIStackView 2022-01-01
- URL编码Swift iOS 2022-01-01
- SetOnItemSelectedListener上的微调程序错误 2022-01-01
- 类似于 Mail.app 的 iPad 模态视图控制器? 2022-01-01
- 网上有没有好的 UIScrollView 教程? 2022-01-01
- 在 Iphone SDK 的导航栏上添加多个按钮 2022-01-01
- UITextView 内容插图 2022-01-01
