我按照以下说明操作:https ://ionicframework.com/docs/native/unique-device-id/并version 5.0.0
已安装
ts文件:
import { UniqueDeviceID } from '@ionic-native/unique-device-id/ngx';
constructor(private uniqueDeviceID: UniqueDeviceID) { }
this.uniqueDeviceID.get()
.then((uuid: any) => console.log(uuid))
.catch((error: any) => console.log(error));
在app.module.ts 中:
import { UniqueDeviceID } from '@ionic-native/unique-device-id/ngx';
providers: [
StatusBar,
UniqueDeviceID,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
错误: