f***@sina.cn
f***@sina.cn
  • 发布:2024-09-30 08:19
  • 更新:2024-12-16 18:18
  • 阅读:148

【报Bug】Hbuilder上可以打印cid值,xcode上没有

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 14.3.1 (23D60)

HBuilderX类型: 正式

HBuilderX版本号: 4.23

手机系统: iOS

手机系统版本号: iOS 13.0

手机厂商: 苹果

手机机型: iPhone10

页面类型: vue

vue版本: vue2

打包方式: 离线

项目创建方式: HBuilderX

示例代码:

getCid() {
let info = plus.push.getClientInfo()
console.log('push info=============', info)
if(info && info["clientid"]) {
let cid = info["clientid"]
console.log('get cid=================', cid)
uni.showToast({
title: 'cid: ' + cid,
icon: 'none'
})
if (cid && cid.length > 0) {
bindPushCid({
equipment_id: cid,
equipment_type: plus.os.name.toLowerCase()
}).then(res => {
if (res.status_code === 200) {
uni.showToast({
title:'推送绑定成功',
icon:'none'
})
}else{
uni.showToast({
title: res.detail || '加载失败',
icon: 'none'
})
}
}).catch((err) => {
uni.showToast({
title: err || '绑定失败',
icon: 'none'
})
})
}
}
},

操作步骤:

getCid() {
let info = plus.push.getClientInfo()
console.log('push info=============', info)
if(info && info["clientid"]) {
let cid = info["clientid"]
console.log('get cid=================', cid)
uni.showToast({
title: 'cid: ' + cid,
icon: 'none'
})
if (cid && cid.length > 0) {
bindPushCid({
equipment_id: cid,
equipment_type: plus.os.name.toLowerCase()
}).then(res => {
if (res.status_code === 200) {
uni.showToast({
title:'推送绑定成功',
icon:'none'
})
}else{
uni.showToast({
title: res.detail || '加载失败',
icon: 'none'
})
}
}).catch((err) => {
uni.showToast({
title: err || '绑定失败',
icon: 'none'
})
})
}
}
},

预期结果:

hbuilder上可以正常打印

实际结果:

xcode上打印出来没有cid

bug描述:

集成推送unipush1.0,云端打包可以通过let info = plus.push.getClientInfo()正常获取cid,由于涉及到了原生插件,只能通过离线打包生成ipa文件,在xcode上运行项目时候,未能正常获取cid,这里遇到了2个问题。

  1. 通过hbuilder直接运行时候 获取到的info对应的appid 不是后台配置的推送应用appid
  2. hbuilder上可以正常打印info,有对应cid值,xcode上没有cid这个字段
2024-09-30 08:19 负责人:无 分享
已邀请:
s***@163.com

s***@163.com

请问xcode没拿到cid这个解决了吗

要回复问题请先登录注册