Skip to content

Instantly share code, notes, and snippets.

@maxkatz
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxkatz/a59737bc5d9c41dd73e7 to your computer and use it in GitHub Desktop.
Save maxkatz/a59737bc5d9c41dd73e7 to your computer and use it in GitHub Desktop.
Code for Native APIs Webinar - April 29, 2015
// Alert
navigator.notification.alert(
'Build apps fast with Appery.io',
alertDismissed,
'My App',
'Got it.'
);
function alertDismissed () {
alert ("Nice - that worked");
}
// Geolocation
var onSuccess = function(position) {
Apperyio("lat").text(position.coords.latitude);
Apperyio("lng").text(position.coords.longitude);
};
function onError(error) {
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
}
navigator.geolocation.getCurrentPosition(onSuccess, onError);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment