Skip to content

Instantly share code, notes, and snippets.

@rjlutz
Last active January 16, 2018 21:35
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 rjlutz/801ba7409c5a9c188c6027a00196e878 to your computer and use it in GitHub Desktop.
Save rjlutz/801ba7409c5a9c188c6027a00196e878 to your computer and use it in GitHub Desktop.
notesf for basic cordova app w/notification dialog
add
<button id="aboutBtn">About</button>
add to onDeviceReady:
document.getElementById("aboutBtn").addEventListener("click", dialogAlert);
add before app.initialize()
function dialogAlert() {
var message = "Bob Lutz, ITEC 4550!";
var title = "About";
var buttonName = "Dismiss";
navigator.notification.alert(message, alertCallback, title, buttonName);
function alertCallback() {
console.log("Thanks for visiting!");
}
}
cordova create aug22 edu.ggc.lutz.firstapp "First App"
cd aug22
cordova platform add android
cordova plugin add cordova-plugin-console
cordova plugin add cordova-plugin-dialogs
cordova run android
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment