summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.xml1
-rw-r--r--package.json3
-rw-r--r--www/js/EventServer.js27
3 files changed, 24 insertions, 7 deletions
diff --git a/config.xml b/config.xml
index 7065697e..105bea09 100644
--- a/config.xml
+++ b/config.xml
@@ -179,6 +179,7 @@
<plugin name="cordova-plugin-ionic-webview" spec="https://github.com/pliablepixels/cordova-plugin-ionic-webview.git">
<variable name="ANDROID_SUPPORT_ANNOTATIONS_VERSION" value="27.+" />
</plugin>
+ <plugin name="cordova-plugin-media-pp-fork" spec="^1.0.2-dev" />
<engine name="android" spec="8.0.0" />
<engine name="ios" spec="^5.0.1" />
</widget>
diff --git a/package.json b/package.json
index 739c68dc..aa5502fd 100644
--- a/package.json
+++ b/package.json
@@ -61,7 +61,8 @@
},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
- }
+ },
+ "cordova-plugin-media-pp-fork": {}
}
},
"dependencies": {
diff --git a/www/js/EventServer.js b/www/js/EventServer.js
index ad5f673a..71718988 100644
--- a/www/js/EventServer.js
+++ b/www/js/EventServer.js
@@ -276,6 +276,13 @@ angular.module('zmApp.controllers')
function setupMobileSocket() {
+ if (!pushInited) {
+ NVR.debug ("Calling pushInit()");
+ pushInit();
+ } else {
+ NVR.debug ("pushInit() already done");
+ }
+
var loginData = NVR.getLogin();
var d = $q.defer();
@@ -300,10 +307,6 @@ angular.module('zmApp.controllers')
// console.log("Connected to WebSocket with id: " + success.webSocketId);
nativeWebSocketId = success.webSocketId;
handleOpen(success);
- if (!pushInited) {
- NVR.debug("EventSever: Initializing FCM push");
- pushInit();
- }
d.resolve(true);
return d.promise;
},
@@ -556,7 +559,7 @@ angular.module('zmApp.controllers')
// "senderID": zm.gcmSenderId,
"icon": "ic_stat_notification",
sound: "true",
- vibrate: ld.vibrateOnPush
+ vibrate: "true",
//"sound": android_media_file
}
}
@@ -565,8 +568,20 @@ angular.module('zmApp.controllers')
}
+ PushNotification.hasPermission(function (succ) {
+ NVR.debug ("Push permission returned: "+JSON.stringify(succ));
+ }, function (err) {
+ NVR.debug ("Push permission error returned: "+JSON.stringify(err));
+ });
// console.log("*********** MEDIA BLOG IS " + mediasrc);
- media = $cordovaMedia.newMedia(mediasrc);
+
+ try {
+ media = $cordovaMedia.newMedia(mediasrc);
+ }
+ catch (err) {
+ NVR.debug ("Media init error:"+JSON.stringify(err));
+ }
+
push.on('registration', function (data) {