I am using the Device API from Capacitor (https://capacitorjs.com/docs/apis/device#deviceinfo) along with Ionic Framework and VueJS. The goal is to retrieve the UUID from an Android device.
When opening the application in my browser, I can see the device info that I'm logging. However, when opening it on an Android Device / Android Studio I get this error:
Uncaught (in promise) Error: "Device" plugin is not implemented on android
As far as I know the plugin is supported on Android.. What am I doing wrong?
Code:
import { Device } from "@capacitor/device";
async getDeviceInfo() {
const info = await Device.getId();
this.uuid = info.uuid;
alert(this.uuid);
const moreInfo = await Device.getInfo();
const battery = await Device.getBatteryInfo();
alert(JSON.stringify(moreInfo));
alert(JSON.stringify(battery));
alert("test");
},