Skip to content

Instantly share code, notes, and snippets.

@pdesterlich
Created March 12, 2018 13:25
Show Gist options
  • Save pdesterlich/b5348b0505e838748877b2773ee5a4a8 to your computer and use it in GitHub Desktop.
Save pdesterlich/b5348b0505e838748877b2773ee5a4a8 to your computer and use it in GitHub Desktop.
nativescript-vue read device uuid
<template>
<Page class="page">
<StackLayout>
<Label :text="uuid"></Label>
</StackLayout>
</Page>
</template>
<script>
import * as platform from "tns-core-modules/platform";
export default {
data () {
return {
uuid: '',
}
},
components: ['terminale'],
mounted () {
console.log("EVENT: mounted");
try {
this.uuid = platform.device.uuid;
}
catch (err) {
this.uuid = "error : " + err.message;
console.log("reading UUDI: " + err.message);
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment