mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-04-02 03:00:08 -04:00
57 lines
1.8 KiB
HTML
Executable File
57 lines
1.8 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<!-- Change this if you want to allow scaling -->
|
|
<meta name="viewport" content="width=default-width; user-scalable=no" />
|
|
|
|
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
|
|
|
<title>example</title>
|
|
|
|
<!-- iPad/iPhone specific css below, add after your main css >
|
|
<link rel="stylesheet" media="only screen and (max-device-width: 1024px)" href="ipad.css" type="text/css" />
|
|
<link rel="stylesheet" media="only screen and (max-device-width: 480px)" href="iphone.css" type="text/css" />
|
|
-->
|
|
<!-- If you application is targeting iOS BEFORE 4.0 you MUST put json2.js from http://www.JSON.org/json2.js into your www directory and include it here -->
|
|
<script type="text/javascript" charset="utf-8" src="phonegap.0.9.4.min.js"></script>
|
|
<script type="text/javascript" charset="utf-8" src="LocalNotification.js"></script>
|
|
<script type="text/javascript" charset="utf-8">
|
|
|
|
|
|
// If you want to prevent dragging, uncomment this section
|
|
/*
|
|
function preventBehavior(e)
|
|
{
|
|
e.preventDefault();
|
|
};
|
|
document.addEventListener("touchmove", preventBehavior, false);
|
|
*/
|
|
|
|
function onBodyLoad()
|
|
{
|
|
document.addEventListener("deviceready",onDeviceReady,false);
|
|
}
|
|
|
|
/* When this function is called, PhoneGap has been initialized and is ready to roll */
|
|
function onDeviceReady()
|
|
{
|
|
var d = new Date();
|
|
d = d.getTime() + 60*1000; //10 seconds from now
|
|
d = new Date(d);
|
|
plugins.localNotification.add({
|
|
date: d,
|
|
message: 'This is an alert message',
|
|
hasAction: true,
|
|
badge: 1,
|
|
id: '123'
|
|
});
|
|
}
|
|
|
|
</script>
|
|
</head>
|
|
<body onload="onBodyLoad()">
|
|
Notification will show in 1 minute<br/>
|
|
Hit the home button so the notification will show
|
|
</body>
|
|
</html>
|