Created
March 12, 2018 13:25
-
-
Save pdesterlich/b5348b0505e838748877b2773ee5a4a8 to your computer and use it in GitHub Desktop.
nativescript-vue read device uuid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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