1***@qq.com
1***@qq.com
  • 发布:2021-07-23 14:21
  • 更新:2021-07-23 14:21
  • 阅读:480

【报Bug】oppo r9手机无法通过 plus.push.getClientInfo() 获取 clientid

分类:HTML5+

产品分类: HTML5+

HBuilderX版本号: 3.1.22

手机系统: Android

手机系统版本号: Android 5.1

手机厂商: OPPO

手机机型: oppp r7m

打包方式: 云端

示例代码:

APP.VUE页面
···
onLaunch: function() {
console.log('App Launch');
// #ifdef APP-PLUS
let result = plus.push.getClientInfo();
if (result && result.clientid && result.clientid !== 'null') {
console.info('初始化客户端标识={APP}', result.clientid);
uni.setStorageSync('deviceNo', result.clientid);
} else {
var obtainingCIDTimer = setInterval(function() {
result = plus.push.getClientInfo();
if (result.clientid && result.clientid !== 'null') {
console.info('延迟获取客户端标识={APP}', result.clientid);
uni.setStorageSync('deviceNo', result.clientid);
clearInterval(obtainingCIDTimer);
}else{
console.error('5+ API首次初始化客户端标识 clientid 失败,原因:客户端向推送服务器注册还未完成,正在延时重试。');
}
}, 50);
}
// #endif
},
···

操作步骤:

let cid= plus.push.getClientInfo().clientid;
console.log(cid)

预期结果:

正常或延时获取到cid非null值

实际结果:

···
{
"id": "unipush",
"token": "null",
"clientid": "null",
"appid": "pPyZWvH3Fa6PXba10aJ009",
"appkey": "b7dOGlNPHR7pqwUxDhpTi4"
}
···

bug描述:

通过5+API获取cid本地持久化,
oppo r9m 无法在app启动正确获取clientid,无论是否首次、延时获取,都是字符串null

2021-07-23 14:21 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复

  • 标题 / 粗斜体
  • 代码片段
  • 超链接 / 图片 / 视频
  • 列表 / 引用

文章内容较多时,可以用标题分段 :

## 大标题 
### 小标题

斜体 / 粗体 :

**粗体** 
*斜体*
***粗斜体***

代码片段 :

``` javascript
代码片段
```

超链接 :

[链接文字](链接地址) 例: [百度](http://www.baidu.com)

图片 :

![图片说明](图片地址) 例: ![百度logo](http://www.baidu.com/img/bdlogo.gif)

视频 :

!![视频说明](视频地址) 例: !![优酷视频](http://youku.com)

有序列表 :

1. 123
2. 123
3. 123

无序列表 :

- 123
- 123
- 123

引用 : ( 双回车后结束引用 )

> 引用内容
引用内容
引用内容