Last active
April 10, 2016 22:57
-
-
Save AysadKozanoglu/980959d8f420e25f31222a127f82d8ee to your computer and use it in GitHub Desktop.
Cordova Notification html Beispiel de.appplant.cordova.plugin.local-notification
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Device Ready Example</title> | |
<script type="text/javascript" charset="utf-8" src="cordova.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
// Wait for device API libraries to load | |
// | |
function onLoad() { | |
document.addEventListener("deviceready", onDeviceReady, false); | |
} | |
// device APIs are available | |
// | |
function onDeviceReady() { | |
// Now safe to use device APIs | |
//alert("init ok"); | |
hasPermission = function () { | |
alert("rechte check starten"); | |
cordova.plugins.notification.local.hasPermission(function (granted) { | |
if (granted) | |
alert("JA"); | |
else | |
alert("nein keine rechte"); | |
}); | |
// aufruf zum registrieren wird nur einmal aufgefordert | |
// danach nur manuell über einstellungen | |
cordova.plugins.notification.local.registerPermission(function (granted) { | |
if (granted) | |
alert("bereits registriert"); | |
else | |
alert("nicht registriert"); | |
}); | |
}; | |
scheduleMultiple = function () { | |
alert("Dostum 4 saniye sonra 11 tane Msj darbesi bazinda gecirecem telefonununa. Sonra her 3 saniye periyodunda siparis yagacak OK ye bastikdan hemen sonra Home Dügmesine bas app arka plana atmak icin yani app'i kayip etmek icin. bu test 4 saat i mi aldi. IOS android ve windows icin. Bas OK ye BAS :) "); | |
setTimeout(function () { | |
cordova.plugins.notification.local.schedule([{ | |
id: 1, | |
text: 'Levent kardesim icin' | |
}, { | |
id: 2, | |
text: 'Aysad derler bana' | |
}, { | |
id: 3, | |
text: 'Hallotaxi taxi wird gebraucht Oh Yeahh' | |
}, { | |
id: 4, | |
text: 'Ich will taxi' | |
}, { | |
id: 5, | |
text: 'ich habe gesagt, ich will taxi!' | |
}, { | |
id: 6, | |
text: 'ich beschwere mich bei deinem Chef' | |
}, { | |
id: 7, | |
text: 'mach doch alter' | |
}, { | |
id: 8, | |
text: 'evet chef ini ariyacam' | |
}, { | |
id: 9, | |
text: 'her horoz kendi kümesinde ötermis' | |
}, { | |
id: 10, | |
text: 'erken öten horozu ne yapiyorlar?' | |
}, { | |
id: 11, | |
text: 'gelirsem gösterrim ne yapiyorlar' | |
}]); | |
}, 4000); | |
var i=12; | |
setTimeout(function () { | |
setInterval(function(){ | |
cordova.plugins.notification.local.schedule([{ | |
id: i, | |
text: i+' Hallotaxi-Rufzentrale: Neue Taxibestellung' | |
}]); | |
i++; | |
}, 3000); | |
}, 12); | |
}; | |
}; | |
</script> | |
</head> | |
<body onload="onLoad()" style="width=100%; font-family:arial,tahoma; font-size:14px"> | |
<center> | |
<img src="logo.png" width="50%" border=0> | |
<br> | |
<h1>Entwicklungsumgebung</h1> | |
<br> | |
push Nachricht Test | |
<br><br><br> | |
<font color="black"><b>Wichtig:</b> <u>zu erst Rechte überprüfen</u></font> | |
<br><br> | |
<button onclick="hasPermission()" style="height:60px;width:80%">Prüfung starten</button> | |
<br><br><br> | |
<button onclick="scheduleMultiple()"style="height:60px; width:80%" > push Nachricht starten</button> | |
<br><br><font size="-2"> Erfinder: Levent Yakar <br> Architekt: Aysad Kozanoglu | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment