Skip to content

Commit

Permalink
feat(device): Add button for getId (#168)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed May 10, 2021
1 parent 9bc596a commit a36a950
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/pages/Device.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ const DevicePage: React.FC = () => {
setDeviceInfoJson(JSON.stringify(info, null, 2));
};

const getDeviceId = async () => {
const id = await Device.getId();
console.log('Got device id', id);
setDeviceInfoJson(JSON.stringify(id, null, 2));
};

const getDeviceBatteryInfo = async () => {
const info = await Device.getBatteryInfo();
console.log('Got device battery info', info);
Expand All @@ -45,6 +51,9 @@ const DevicePage: React.FC = () => {
<IonButton expand="block" onClick={getDeviceInfo}>
Device Info
</IonButton>
<IonButton expand="block" onClick={getDeviceId}>
Device Id
</IonButton>
<IonButton expand="block" onClick={getDeviceBatteryInfo}>
Device Battery Info
</IonButton>
Expand Down

0 comments on commit a36a950

Please sign in to comment.