Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ...
- //
- // push plugin
- document.addEventListener("deviceready", function(){
- var push = PushNotification.init({
- "android": {"senderID": "NUMERO DO SENDER ID"},
- "ios": {"alert": "true", "badge": "true", "sound": "true"},
- "windows": {}
- });
- push.on('registration', function(data) {
- setTimeout(function(){
- angular.element(document.body).scope().regtoken(data);
- },3000);
- });
- push.on('notification', function(data) {
- console.debug(data);
- // data.message,
- // data.title,
- // data.count,
- // data.sound,
- // data.image,
- // data.additionalData
- // setTimeout(function(){
- angular.element(document.body).scope().incrNotif();
- // },3000);
- });
- });
- document.addEventListener('deviceready', function () {
- if (navigator.notification) { // Override default HTML alert with native dialog
- window.alert = function (message) {
- navigator.notification.alert(
- message, // message
- null, // callback
- "Ambbi app", // title
- 'OK' // buttonName
- );
- };
- }
- }, false);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement