mirror of
https://github.com/purplecabbage/phonegap-plugins.git
synced 2026-04-24 03:00:11 -04:00
NotificationEx - added README and sample index.html
This commit is contained in:
9
iPhone/NotificationEx/README.md
Normal file
9
iPhone/NotificationEx/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
## NotificationEx - Adding the Plugin to your project ##
|
||||
|
||||
These are removed functions from PhoneGap core (Notification.loadingStart/Stop, and Notification.activityStart/Stop)
|
||||
Using this plugin requires [iPhone PhoneGap](http://github.com/phonegap/phonegap-iphone) 1.0.0
|
||||
|
||||
1. Add all the .h and .m files to your Plugins folder in your project
|
||||
2. Add the .js files to your "www" folder on disk, and add a reference to the .js file as <script> tags in your html file(s)
|
||||
3. In your project's PhoneGap.plist, find the Plugins section. Add a new entry under there, the key is "NotificationEx", value is "NotificationEx".
|
||||
4. See the sample index.html for usage examples
|
||||
66
iPhone/NotificationEx/index.html
Normal file
66
iPhone/NotificationEx/index.html
Normal file
@@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no;" />
|
||||
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
|
||||
|
||||
<!-- 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 your 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-1.0.0rc1.min.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="notificationex.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);
|
||||
*/
|
||||
|
||||
/* If you are supporting your own protocol, the var invokeString will contain any arguments to the app launch.
|
||||
see http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
|
||||
for more details -jm */
|
||||
/*
|
||||
function handleOpenURL(url)
|
||||
{
|
||||
// TODO: do something with the url passed in.
|
||||
}
|
||||
*/
|
||||
|
||||
function onBodyLoad()
|
||||
{
|
||||
document.addEventListener("deviceready",onDeviceReady,false);
|
||||
}
|
||||
|
||||
/* When this function is called, PhoneGap has been initialized and is ready to roll */
|
||||
/* If you are supporting your own protocol, the var invokeString will contain any arguments to the app launch.
|
||||
see http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
|
||||
for more details -jm */
|
||||
function onDeviceReady()
|
||||
{
|
||||
// do your thing!
|
||||
//navigator.notification.alert("PhoneGap is working")
|
||||
navigator.notificationEx.loadingStart();
|
||||
navigator.notificationEx.activityStart();
|
||||
setTimeout(function() {
|
||||
navigator.notificationEx.loadingStop();
|
||||
}, 3000);
|
||||
setTimeout(function() {
|
||||
navigator.notificationEx.activityStop();
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body onload="onBodyLoad()">
|
||||
<h1>Hey, it's PhoneGap!</h1>
|
||||
<p>Don't know how to get started? Check out <em><a href="http://github.com/phonegap/phonegap-start">PhoneGap Start</a></em>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user