EMAS我的应用,在使用小米注册的时候总是不成功,我试着把小米的账户放到了demo中,是可以的,但是放到我项目中,使用flutter调用原生然后进行小米注册就不成功了,也不报错,这个还能如何排查呢?能够调用输出日志[MPS:MiPushRegister] register begin我是通过flutter调用原生Android进行的,if(call.method.equals("registerAliyun")){ val account = call.argument("account") val pushService: CloudPushService = PushServiceFactory.getCloudPushService() pushService.setLogLevel(CloudPushService.LOG_DEBUG) //仅适用于Debug包,正式包不需要此行
//获取手机品牌
val deviceId = pushService.deviceId
Log.d(TAG, "bind account deviceId: $deviceId")
pushService.register(applicationContext, object : CommonCallback {
override fun onSuccess(response: String?) {
Log.d(TAG, "init cloudchannel success")
val brand = Build.MANUFACTURER
when{
"xiaomi".equals(brand, true) || "redmi".equals(brand, true) ->{
MiPushRegister.register(applicationContext, "", "")
}
}
pushService.bindAccount(account, object: CommonCallback{
override fun onSuccess(response: String?) {
Log.d(TAG, "bind account success! response: $response")
result.success(true)
}
override fun onFailed(errorCode: String?, errorMsg: String?) {
Log.d(TAG, "bind account failed. errorCode: $errorCode, errorMsg: $errorMsg")
result.error(errorCode, errorMsg, null)
}
})
}
override fun onFailed(errorCode: String, errorMessage: String) {
Log.d(
TAG,
"init cloudchannel failed -- errorcode:$errorCode -- errorMessage:$errorMessage"
)
result.error(errorCode, errorMessage, null)
}
})张京伟@6月9日 13:42 /** 阿里推送 */
implementation 'com.aliyun.ams:alicloud-android-push:3.8.6'
//辅助通道基础依赖
implementation 'com.aliyun.ams:alicloud-android-third-push:3.8.6'
//华为依赖
implementation 'com.aliyun.ams:alicloud-android-third-push-huawei:3.8.6'
//小米国内通道依赖
implementation 'com.aliyun.ams:alicloud-android-third-push-xiaomi:3.8.6.1'
//OPPO依赖
implementation 'com.aliyun.ams:alicloud-android-third-push-oppo:3.8.6'
//vivo依赖
implementation 'com.aliyun.ams:alicloud-android-third-push-vivo:3.8.6'
//魅族依赖
implementation 'com.aliyun.ams:alicloud-android-third-push-meizu:3.8.6'
//荣耀依赖
implementation 'com.aliyun.ams:alicloud-android-third-push-honor:3.8.6',引入的包是这些,我在注册小米的地方注册vivo是可以成功的,正确的,比较了好几遍,而且我这里的代码,放到demo中是正常的
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。