Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plus.device.getInfo方法获取不到手机卡 #5231

Open
kang-hui-jun opened this issue Nov 25, 2024 · 2 comments
Open

plus.device.getInfo方法获取不到手机卡 #5231

kang-hui-jun opened this issue Nov 25, 2024 · 2 comments

Comments

@kang-hui-jun
Copy link

getDeviceInfo() {
// #ifdef APP-PLUS
return new Promise((res, rej) => {
// @ts-ignore
plus.device?.getInfo({
success: function(e) {
console.log("getDeviceInfo success: " + JSON.stringify(e));
res(e.imsi);
},
fail: function(e) {
console.log("getDeviceInfo failed: " + JSON.stringify(e));
rej(e);
},
});
});
// #endif
}

@kang-hui-jun
Copy link
Author

打印输出的结果: getDeviceInfo success: {"imei":"","imsi":[""],"uuid":"ab14ccf2c87c2147"}

在manifest.json文件有添加权限: "<uses-permission android:name="android.permission.READ_PHONE_STATE"/>",

也没有弹出获取设备信息的授权提示框, targetSdkVersion是30

@hbcui1984
Copy link
Contributor

升级HBuilderX到最新版本,然后更换不同手机测试验证一下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants