setTimeout(()=>{
const cid_res = plus.push.getClientInfo();
console.log(cid_res);
},2000)
setTimeout(()=>{
console.log('aaaaaa');
plus.push.getClientInfoAsync( result => {
console.log(result);
}, (error)=>{
console.log(error);
});
},5000)

- 发布:2021-10-21 09:27
- 更新:2021-10-21 09:27
- 阅读:282
产品分类: uniapp/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 10.15.6
HBuilderX类型: 正式
HBuilderX版本号: 3.2.9
手机系统: Android
手机系统版本号: Android 11
手机厂商: ROG Phone 3
手机机型: ROG Phone 3
页面类型: vue
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
app.vue中
setTimeout(()=>{
const cid_res = plus.push.getClientInfo();
console.log(cid_res);
},2000)
setTimeout(()=>{
console.log('aaaaaa');
plus.push.getClientInfoAsync( result => {
console.log(result);
}, (error)=>{
console.log(error);
});
},5000)
app.vue中
setTimeout(()=>{
const cid_res = plus.push.getClientInfo();
console.log(cid_res);
},2000)
setTimeout(()=>{
console.log('aaaaaa');
plus.push.getClientInfoAsync( result => {
console.log(result);
}, (error)=>{
console.log(error);
});
},5000)
预期结果:
{
"id": "unipush",
"token": "**",
"clientid": "**",
"appid": "uhFZGNm9CU8HBJpP6B4BS",
"appkey": "mogSSeOQAF98DLpXlNnFi6"
}
{
"id": "unipush",
"token": "**",
"clientid": "**",
"appid": "uhFZGNm9CU8HBJpP6B4BS",
"appkey": "mogSSeOQAF98DLpXlNnFi6"
}
实际结果:
{
"id": "unipush",
"token": "null",
"clientid": "null",
"appid": "uhFZGNm9CU8HBJpP6B4BS",
"appkey": "mogSSeOQAF98DLpXlNnFi6"
}
{
"code": -1,
"message": "failed,check appkey or appid"
}
{
"id": "unipush",
"token": "null",
"clientid": "null",
"appid": "uhFZGNm9CU8HBJpP6B4BS",
"appkey": "mogSSeOQAF98DLpXlNnFi6"
}
{
"code": -1,
"message": "failed,check appkey or appid"
}
bug描述:
获取clientid为null
0 个回复