Created
April 4, 2018 12:56
-
-
Save ankkal/2f6d8d7e89f5f5bec37724b34187ac5b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
try { | |
consentToken = this.event.context.System.user.permissions.consentToken; | |
deviceId = this.event.context.System.device.deviceId; | |
apiEndpoint = this.event.context.System.apiEndpoint; | |
if(!consentToken || !deviceId || !apiEndpoint) { | |
throw("User did not give us permissions to access their address."); | |
} | |
} catch(e) { | |
this.emit(":tellWithPermissionCard", Messages.NOTIFY_MISSING_PERMISSIONS, PERMISSIONS); | |
// Lets terminate early since we can't do anything else. | |
console.log(JSON.stringify(this.event)); | |
console.error(e); | |
console.info("Ending getAddressHandler()"); | |
return; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment