diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2016-08-27 17:56:26 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2016-08-27 17:56:26 -0400 |
| commit | a4033264aa4ec0827305ba36593bd337a401a320 (patch) | |
| tree | 89744b51ce6528697cfde4923d19e20542eccba9 /www/js/EventServer.js | |
| parent | d0992468cf3cd898e5c459b1cdec9ad3ddfece8b (diff) | |
#312 and #314 - address both I hope. Need to test on iOS
Former-commit-id: cea654de48f8ffcca80a307a7b48f471df345ca7
Diffstat (limited to 'www/js/EventServer.js')
| -rw-r--r-- | www/js/EventServer.js | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/www/js/EventServer.js b/www/js/EventServer.js index 1c214770..7504a3af 100644 --- a/www/js/EventServer.js +++ b/www/js/EventServer.js @@ -68,6 +68,8 @@ angular.module('zmApp.controllers') var d = $q.defer(); var loginData = ZMDataModel.getLogin(); + + console.log ("INIT GOT " + JSON.stringify(loginData)); if (loginData.isUseEventServer == false || !loginData.eventServer) { ZMDataModel.zmLog("No Event Server present. Not initializing"); @@ -75,7 +77,7 @@ angular.module('zmApp.controllers') return d.promise; } - if (!$rootScope.apnsToken) + //if (!$rootScope.apnsToken) pushInit(); @@ -233,6 +235,10 @@ angular.module('zmApp.controllers') //-------------------------------------------------------------------------- // Send an arbitrary object to the Event Serve // currently planned to use it for device token + // isForce =1 when you need to send the message even + // if config says ES is off. This may happen when + // you turn off ES and then we need sendMessage to + // let ZMES know not to send us messages //-------------------------------------------------------------------------- function sendMessage(type, obj, isForce) { var ld = ZMDataModel.getLogin(); @@ -321,11 +327,11 @@ angular.module('zmApp.controllers') } function pushInit() { - ZMDataModel.zmLog("Setting up push registration"); + ZMDataModel.zmLog(">>>Setting up push registration"); var push; var mediasrc; var media; - + var ld = ZMDataModel.getLogin(); var plat = $ionicPlatform.is('ios') ? 'ios' : 'android'; @@ -344,10 +350,10 @@ angular.module('zmApp.controllers') { "ios": { - "alert": "true", - "badge": "true", - "sound": "true", - "clearBadge": "true" + "alert": true, + "badge": true, + "sound": ld.soundOnPush, + "clearBadge": true } } @@ -356,7 +362,6 @@ angular.module('zmApp.controllers') } else { mediasrc = "/android_asset/www/sounds/blop.mp3"; var android_media_file = "blop"; - var ld = ZMDataModel.getLogin(); @@ -367,7 +372,8 @@ angular.module('zmApp.controllers') "android": { "senderID": zm.gcmSenderId, "icon": "ic_stat_notification", - "sound":"true" + sound:ld.soundOnPush, + vibrate: ld.vibrateOnPush //"sound": android_media_file } } @@ -395,7 +401,7 @@ angular.module('zmApp.controllers') platform: plat, token: $rootScope.apnsToken, state: pushstate - }); + },1); }); |
