Bmob官方最近更新了后台域名 ,推送了一条信息

怪不得最近Bmob后台访问数据比较慢,还报错 failed to connect to open2.bmob.cn/ 一类的错误
错误码 errorCode:9015,errorMsg:libcore.io.IoBridge.connectErrno(IoBridge.java:185)
errorMsg:createSubscription failed:failed to connect to *******/******* (port 443) from /********(port 41497) after 30000ms
我还打算升级一下VIP的。o(╥﹏╥)o
嗯,好吧,查看一下官方文档
重置域名
文件、Android SDK 、 API 、 云函数自定义域名绑定功能。 如果使用自定义域名,假设你绑定的sdk域名是testopen.xxx.com,请使用下面的代码,让你的域名在sdk中生效:
Bmob.resetDomain("http://testopen.xxx.com/8/");
如果是自定义域名使用了https,则为:
Bmob.resetDomain("https://testopen.xxx.com/8/");
请直接参考:重置域名设置
注意哦。这里官方没有说清楚
域名应该是这样写,在bmob初始化前

如果还是出现了无法连接bmob云后台的话 可能出现了以下问题
UnknownServiceException: CLEARTEXT communication to localhost not permitted by network security policy
亲的网络安全性配置没有配置好
网络安全性配置
方式一
在AndroidManifest文件中 Application节点下增加
#在AndroidManifest文件的application节点配置
android:usesCleartextTraffic="true"

方式二
在AndroidManifest文件的application节点配置
android:networkSecurityConfig="@xml/network_security_config"

相关xml文件
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" >
</base-config>
</network-security-config>

|