如何在离子/react中使用独立远处

发布于 2025-02-08 23:40:51 字数 452 浏览 2 评论 0原文

我想从设备中获取Iniquededeviceid,然后使用它。我在离子/反应中添加了Angular的溶液,我找不到任何合适的溶液。 样本就是这样 首先,我安装了此内容:

$ ionic cordova plugin add cordova-plugin-uniquedeviceid
$ npm install --save @ionic-native/unique-device-id@4

然后,当我想这样使用时,我会有一个错误。

constructor(private uniqueDeviceID: UniqueDeviceID) { }
this.uniqueDeviceID.get()
.then((uuid: any) => console.log(uuid))
.catch((error: any) => console.log(error));

i want to get Uniquedeviceid from device and then use it . i fount the solution for angular by in ionic/react i didn't find any suitable solution.
the sample is like this
at first i installed this :

$ ionic cordova plugin add cordova-plugin-uniquedeviceid
$ npm install --save @ionic-native/unique-device-id@4

then when i want to use like this i have an error.

constructor(private uniqueDeviceID: UniqueDeviceID) { }
this.uniqueDeviceID.get()
.then((uuid: any) => console.log(uuid))
.catch((error: any) => console.log(error));

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

枫以 2025-02-15 23:40:51

实际上,您只需要核心插件Cordova-Plugin设备,您需要调用对象设备。

Actually you just need the core plugin cordova-plugin-device and you need to call the object device.uuid in order to get the unique device id

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文