summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPliable Pixels <pliablepixels@users.noreply.github.com>2020-08-29 10:20:04 -0400
committerGitHub <noreply@github.com>2020-08-29 10:20:04 -0400
commit7953a77243231f65660787b22a8187fa2dc7bfbf (patch)
treee7a0d7689195fcb813b31d22612a71eb9e44cd5c
parent53d63eb1445603975c556aa49d4b3f15a87867a8 (diff)
parentca768975f2d0258e4e09acc896cee4dd1ee5b0ca (diff)
Merge pull request #964 from pliablepixels/dev
Dev
-rw-r--r--config.xml50
-rw-r--r--docs/guides/FAQ.rst25
-rw-r--r--docs/guides/source.rst43
-rw-r--r--package.json65
-rw-r--r--resources/android/icon/drawable-hdpi-icon.pngbin3161 -> 3002 bytes
-rw-r--r--resources/android/icon/drawable-ldpi-icon.pngbin1398 -> 1555 bytes
-rw-r--r--resources/android/icon/drawable-mdpi-icon.pngbin2078 -> 1990 bytes
-rw-r--r--resources/android/icon/drawable-xhdpi-icon.pngbin4154 -> 4019 bytes
-rw-r--r--resources/android/icon/drawable-xxhdpi-icon.pngbin6195 -> 5956 bytes
-rw-r--r--resources/android/icon/drawable-xxxhdpi-icon.pngbin8231 -> 7919 bytes
-rw-r--r--resources/android/splash/drawable-land-hdpi-screen.pngbin17726 -> 18041 bytes
-rw-r--r--resources/android/splash/drawable-land-ldpi-screen.pngbin6771 -> 6202 bytes
-rw-r--r--resources/android/splash/drawable-land-mdpi-screen.pngbin10105 -> 10001 bytes
-rw-r--r--resources/android/splash/drawable-land-xhdpi-screen.pngbin30192 -> 32918 bytes
-rw-r--r--resources/android/splash/drawable-land-xxhdpi-screen.pngbin40693 -> 43877 bytes
-rw-r--r--resources/android/splash/drawable-land-xxxhdpi-screen.pngbin53718 -> 57440 bytes
-rw-r--r--resources/android/splash/drawable-port-hdpi-screen.pngbin18160 -> 17645 bytes
-rw-r--r--resources/android/splash/drawable-port-ldpi-screen.pngbin6903 -> 6185 bytes
-rw-r--r--resources/android/splash/drawable-port-mdpi-screen.pngbin10366 -> 9966 bytes
-rw-r--r--resources/android/splash/drawable-port-xhdpi-screen.pngbin31026 -> 32222 bytes
-rw-r--r--resources/android/splash/drawable-port-xxhdpi-screen.pngbin41584 -> 43198 bytes
-rw-r--r--resources/android/splash/drawable-port-xxxhdpi-screen.pngbin54940 -> 56926 bytes
-rw-r--r--resources/ios/icon/icon-1024.pngbin32775 -> 22423 bytes
-rw-r--r--resources/ios/icon/icon-108@2x.pngbin0 -> 8452 bytes
-rw-r--r--resources/ios/icon/icon-20.pngbin0 -> 705 bytes
-rw-r--r--resources/ios/icon/icon-20@2x.pngbin0 -> 1476 bytes
-rw-r--r--resources/ios/icon/icon-20@3x.pngbin0 -> 2262 bytes
-rw-r--r--resources/ios/icon/icon-24@2x.pngbin0 -> 1798 bytes
-rw-r--r--resources/ios/icon/icon-27.5@2x.pngbin0 -> 2051 bytes
-rw-r--r--resources/ios/icon/icon-29.pngbin0 -> 1035 bytes
-rw-r--r--resources/ios/icon/icon-29@2x.pngbin0 -> 2202 bytes
-rw-r--r--resources/ios/icon/icon-29@3x.pngbin0 -> 3363 bytes
-rw-r--r--resources/ios/icon/icon-40.pngbin1526 -> 1476 bytes
-rw-r--r--resources/ios/icon/icon-40@2x.pngbin3486 -> 3011 bytes
-rw-r--r--resources/ios/icon/icon-40@3x.pngbin5265 -> 4545 bytes
-rw-r--r--resources/ios/icon/icon-44@2x.pngbin0 -> 3404 bytes
-rw-r--r--resources/ios/icon/icon-50.pngbin2181 -> 1886 bytes
-rw-r--r--resources/ios/icon/icon-50@2x.pngbin4386 -> 3784 bytes
-rw-r--r--resources/ios/icon/icon-60.pngbin2647 -> 2262 bytes
-rw-r--r--resources/ios/icon/icon-60@2x.pngbin5265 -> 4545 bytes
-rw-r--r--resources/ios/icon/icon-60@3x.pngbin7814 -> 7090 bytes
-rw-r--r--resources/ios/icon/icon-72.pngbin3161 -> 2701 bytes
-rw-r--r--resources/ios/icon/icon-72@2x.pngbin6195 -> 5639 bytes
-rw-r--r--resources/ios/icon/icon-76.pngbin3352 -> 2858 bytes
-rw-r--r--resources/ios/icon/icon-76@2x.pngbin6643 -> 6017 bytes
-rw-r--r--resources/ios/icon/icon-83.5@2x.pngbin7168 -> 6413 bytes
-rw-r--r--resources/ios/icon/icon-86@2x.pngbin0 -> 6601 bytes
-rw-r--r--resources/ios/icon/icon-98@2x.pngbin0 -> 7789 bytes
-rw-r--r--resources/ios/icon/icon.pngbin2451 -> 2101 bytes
-rw-r--r--resources/ios/icon/icon@2x.pngbin4988 -> 4419 bytes
-rw-r--r--resources/ios/splash/Default-1792h~iphone.pngbin0 -> 47347 bytes
-rw-r--r--resources/ios/splash/Default-2436h.pngbin0 -> 74246 bytes
-rw-r--r--resources/ios/splash/Default-2688h~iphone.pngbin0 -> 86916 bytes
-rw-r--r--resources/ios/splash/Default-568h@2x~iphone.pngbin26982 -> 27372 bytes
-rw-r--r--resources/ios/splash/Default-667h.pngbin32395 -> 33336 bytes
-rw-r--r--resources/ios/splash/Default-736h.pngbin62886 -> 66631 bytes
-rw-r--r--resources/ios/splash/Default-Landscape-1792h~iphone.pngbin0 -> 48825 bytes
-rw-r--r--resources/ios/splash/Default-Landscape-2436h.pngbin0 -> 77854 bytes
-rw-r--r--resources/ios/splash/Default-Landscape-2688h~iphone.pngbin0 -> 90615 bytes
-rw-r--r--resources/ios/splash/Default-Landscape-736h.pngbin62629 -> 69226 bytes
-rw-r--r--resources/ios/splash/Default-Landscape@2x~ipad.pngbin59305 -> 66264 bytes
-rw-r--r--resources/ios/splash/Default-Landscape@~ipadpro.pngbin87979 -> 81351 bytes
-rw-r--r--resources/ios/splash/Default-Landscape~ipad.pngbin25129 -> 26015 bytes
-rw-r--r--resources/ios/splash/Default-Portrait@2x~ipad.pngbin59374 -> 64998 bytes
-rw-r--r--resources/ios/splash/Default-Portrait@~ipadpro.pngbin88671 -> 81623 bytes
-rw-r--r--resources/ios/splash/Default-Portrait~ipad.pngbin25496 -> 25631 bytes
-rw-r--r--resources/ios/splash/Default@2x~iphone.pngbin22993 -> 22677 bytes
-rw-r--r--resources/ios/splash/Default@2x~universal~anyany.pngbin97293 -> 89770 bytes
-rw-r--r--resources/ios/splash/Default~iphone.pngbin10366 -> 9966 bytes
-rw-r--r--www/js/EventCtrl.js22
-rw-r--r--www/js/EventServer.js347
-rw-r--r--www/js/NVR.js2
-rwxr-xr-xwww/js/app.js2
73 files changed, 328 insertions, 228 deletions
diff --git a/config.xml b/config.xml
index ada481ec..77963746 100644
--- a/config.xml
+++ b/config.xml
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninja_pro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.4.010" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninja_pro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.5.000" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>zmNinja</name>
<description>
High performance ZoneMinder client
@@ -35,7 +35,7 @@
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreen" value="false" />
<preference name="BackgroundColor" value="#444444" />
- <preference name="android-targetSdkVersion" value="28" />
+ <preference name="android-targetSdkVersion" value="29" />
<preference name="android-minSdkVersion" value="21" />
<preference name="SplashScreenBackgroundColor" value="#ababab" />
<feature name="StatusBar">
@@ -49,7 +49,6 @@
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<resource-file src="www/sounds/blop.caf" target="blop.caf" />
- <resource-file src="GoogleService-Info.plist" />
<custom-config-file parent="NSAppTransportSecurity" target="*-Info.plist">
<dict>
<key>NSAllowsArbitraryLoads</key>
@@ -85,7 +84,7 @@
<icon height="87" src="resources/ios/icon/icon-small@3x.png" width="87" />
<splash src="resources/Default@2x~universal~anyany.png" />
<icon height="1024" src="resources/icon_for_apppublish_1024x1024_no_alpha.jpg" width="1024" />
- <splash src="resources/ios/splash/Default@2x~universal~anyany.png" />
+ <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
<splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
<splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
<splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
@@ -99,6 +98,24 @@
<splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
<splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
<icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
+ <icon height="20" src="resources/ios/icon/icon-20.png" width="20" />
+ <icon height="40" src="resources/ios/icon/icon-20@2x.png" width="40" />
+ <icon height="60" src="resources/ios/icon/icon-20@3x.png" width="60" />
+ <icon height="29" src="resources/ios/icon/icon-29.png" width="29" />
+ <icon height="58" src="resources/ios/icon/icon-29@2x.png" width="58" />
+ <icon height="87" src="resources/ios/icon/icon-29@3x.png" width="87" />
+ <icon height="48" src="resources/ios/icon/icon-24@2x.png" width="48" />
+ <icon height="55" src="resources/ios/icon/icon-27.5@2x.png" width="55" />
+ <icon height="88" src="resources/ios/icon/icon-44@2x.png" width="88" />
+ <icon height="172" src="resources/ios/icon/icon-86@2x.png" width="172" />
+ <icon height="196" src="resources/ios/icon/icon-98@2x.png" width="196" />
+ <icon height="216" src="resources/ios/icon/icon-108@2x.png" width="216" />
+ <splash height="2688" src="resources/ios/splash/Default-2688h~iphone.png" width="1242" />
+ <splash height="1242" src="resources/ios/splash/Default-Landscape-2688h~iphone.png" width="2688" />
+ <splash height="1792" src="resources/ios/splash/Default-1792h~iphone.png" width="828" />
+ <splash height="828" src="resources/ios/splash/Default-Landscape-1792h~iphone.png" width="1792" />
+ <splash height="2436" src="resources/ios/splash/Default-2436h.png" width="1125" />
+ <splash height="1125" src="resources/ios/splash/Default-Landscape-2436h.png" width="2436" />
</platform>
<platform name="android">
<preference name="MixedContentMode" value="2" />
@@ -147,11 +164,9 @@
<plugin name="cordova-plugin-insomnia" spec="^4.3.0" />
<plugin name="cordova-plugin-pin-dialog" spec="^0.1.3" />
<plugin name="cordova-plugin-splashscreen" spec="^4.1.0" />
- <plugin name="cordova-sqlite-storage" spec="^1.5.3" />
<plugin name="cordova-plugin-android-fingerprint-auth" spec="^1.5.0" />
<plugin name="cordova-plugin-network-information" spec="^2.0.1" />
<plugin name="cordova-plugin-device" spec="^2.0.2" />
- <plugin name="cordova-plugin-file" spec="^6.0.1" />
<plugin name="cordova-library-helper-pp-fork" spec="^1.0.1" />
<plugin name="cordova-plugin-multi-window" spec="0.0.3" />
<plugin name="cordova-plugin-ignore-lint-translation" spec="0.0.1" />
@@ -160,35 +175,22 @@
</plugin>
<plugin name="cordova-custom-config" spec="5.0.2" />
<plugin name="cordova-plugin-advanced-websocket" spec="1.1.5" />
- <plugin name="cordova-plugin-add-swift-support" spec="1.7.2" />
- <plugin name="cordova-plugin-photo-library" spec="https://github.com/pliablepixels/cordova-plugin-photo-library">
- <variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value=" " />
- </plugin>
<plugin name="cordova-support-google-services" spec="1.3.2" />
- <plugin name="phonegap-plugin-push" spec="2.3.0">
- <variable name="ANDROID_SUPPORT_V13_VERSION" value="27.+" />
- <variable name="FCM_VERSION" value="17.0.+" />
- </plugin>
<plugin name="cordova-plugin-x-socialsharing" spec="5.6.4">
<variable name="ANDROID_SUPPORT_V4_VERSION" value="24.1.1+" />
<variable name="PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION" value="This app requires photo library access to function properly." />
<variable name="PHOTO_LIBRARY_USAGE_DESCRIPTION" value="This app requires photo library access to function properly." />
</plugin>
+ <plugin name="cordova-plugin-firebasex" spec="latest">
+ <variable name="FIREBASE_ANALYTICS_COLLECTION_ENABLED" value="false" />
+ <variable name="FIREBASE_PERFORMANCE_COLLECTION_ENABLED" value="false" />
+ <variable name="FIREBASE_CRASHLYTICS_COLLECTION_ENABLED" value="false" />
+ </plugin>
<plugin name="cordova-plugin-ionic-keyboard" spec="2.2.0" />
<plugin name="cordova-plugin-touch-id" spec="3.4.0">
<variable name="FACEID_USAGE_DESCRIPTION" value="" />
</plugin>
<plugin name="cordova-plugin-android-permissions" spec="1.0.2" />
<plugin name="cordova-plugin-app-version" spec="0.1.9" />
- <plugin name="cordova-plugin-inappbrowser" spec="https://github.com/apache/cordova-plugin-inappbrowser.git" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.4" />
- <plugin name="cordova-plugin-advanced-http" spec="^2.5.1">
- <variable name="OKHTTP_VERSION" value="3.10.0" />
- </plugin>
- <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="^4.5.5" />
</widget>
diff --git a/docs/guides/FAQ.rst b/docs/guides/FAQ.rst
index 17e45d20..cb67a498 100644
--- a/docs/guides/FAQ.rst
+++ b/docs/guides/FAQ.rst
@@ -56,7 +56,7 @@ This is why:
site or send it to a colleague or family member who may make it available for
everyone else to download. I know most of you have no such intentions, but I know
for sure, a few do (I've had my apk show up on mediashare sites in the past).
- For everyone who has asked me to "make an exception only once", I'd do that only
+ For everyone who has asked me to make an exception only once, I'd do that only
if I knew you. If I did not, I should be making the same exception to
everyone who has asked me.
@@ -632,6 +632,29 @@ Event stream viewing does not work
- Look at apache error logs - it often gives you hints
+Video takes too long to play
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+- Around April 2020, I've received the occasional email about videos suddenly Taking
+ longer to play. There are a few potential reasons for this:
+
+ - You upgraded zoneminder and switched your monitors to store mp4 videos. When you
+ do that, the mobile device takes time to download the video. Yes, I know your desktop
+ browser is faster. Maybe that is how mobile video players work. I don't do anything special
+ in zmNinja - I just pass the video to the browser canvas to play using ``<video>`` tags.
+
+ - A change was made to ZoneMinder which allowed "fragmented" videos to be played.
+ This allows videos that are in progress to be played. Technically, it should make
+ things faster but some have complained this makes download slower.
+
+ - Potential solutions:
+
+ - In zmNinja, go to ``Menu->Monitors``, click on ``Configuration`` for that monitor
+ and enable "Force MJPEG". This will force MPJEG playback for events
+
+ - I am told in future versions of ZoneMinder, there will be an option to turn off
+ this fragmented feature. Note that if you turn it off, you may not get push notification
+ animations in zmninja (if you have it enabled)
+
Video Not Playable
~~~~~~~~~~~~~~~~~~
- Your video may be using a codec that is not supported on mobile browsers.
diff --git a/docs/guides/source.rst b/docs/guides/source.rst
index 1eb67b32..c1f62f1a 100644
--- a/docs/guides/source.rst
+++ b/docs/guides/source.rst
@@ -24,28 +24,33 @@ Output of ``ionic info``
::
+
Ionic:
- ionic (Ionic CLI) : 4.5.0 (/usr/local/lib/node_modules/ionic)
- Ionic Framework : ionic1 1.3.5
- @ionic/v1-toolkit : 1.0.19
+ Ionic CLI : 6.9.3 (/Users/pp/.nvm/versions/node/v12.17.0/lib/node_modules/@ionic/cli)
+ Ionic Framework : unknown
+ @ionic/v1-toolkit : 1.0.22
Cordova:
- cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
- Cordova Platforms : android 7.1.4, ios 5.0.0
- Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0,
- (and 30 other plugins)
+ Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
+ Cordova Platforms : android 8.1.0, ios 5.1.1
+ Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, (and 29 other plugins)
+
+ Utility:
+
+ cordova-res : not installed
+ native-run : not installed
System:
- Android SDK Tools : 26.1.1 (/Users/pp/Library/Android/sdk/)
- ios-deploy : 2.0.0
- ios-sim : 7.0.0
- NodeJS : v8.11.2 (/usr/local/bin/node)
- npm : 5.6.0
- OS : macOS Mojave
- Xcode : Xcode 10.1 Build version 10B61
+ Android SDK Tools : 26.1.1 (/Users/pp/Library/Android/sdk)
+ ios-deploy : 1.10.0
+ ios-sim : 8.0.2
+ NodeJS : v12.17.0 (/Users/pp/.nvm/versions/node/v12.17.0/bin/node)
+ npm : 6.14.4
+ OS : macOS Catalina
+ Xcode : Xcode 11.6 Build version 11E708
Install Dependencies - needed for all platforms
-----------------------------------------------
@@ -120,7 +125,7 @@ this)
(Harder) If you need picture notification support in push
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-As of Mar 2019, cordova-ios does not support multiple targets, nor does
+As of Aug 2020, cordova-ios does not support multiple targets, nor does
it support automatic building of notification extensions. So there is manual work to be done:
- Open up ``platforms/ios/zmNinja.xcworkspace`` in XCode
@@ -133,8 +138,12 @@ it support automatic building of notification extensions. So there is manual wor
- Now in XCode Targets, select ``zmNinjaNotification``, and make sure you select a Team and make sure Deployment Target is 11 or above
- Change Deployment target to 11 or above (same as zmNinja target)
- ``cp etc/NotificationService.m platforms/ios/zmNinjaNotification/``
-- ``cd platforms/ios/``
-- ``pod install``
+
+Starting 1.5.0, zmNinja uses the `cordova-plugin-firebasex <https://github.com/dpa99c/cordova-plugin-firebasex>`__
+library for push notifications. The older cordova-push-plugin is no longer supported by the author.
+If you are facing compilation issues that relate to this plugin, please make sure you read it's troubleshooting section,
+especially around outdated pods et. al.
+
You can now do `build_ios.sh`. However, after you build, you will have to go back to XCode
after the build to make the following changes:
diff --git a/package.json b/package.json
index 534b2731..5dbc127c 100644
--- a/package.json
+++ b/package.json
@@ -1,14 +1,14 @@
{
"name": "zmninjapro",
"description": "Home security mobile app for ZoneMinder",
- "version": "1.4.009",
+ "version": "1.5.000",
"displayName": "zmNinja",
"author": "Pliable Pixels",
"license": "custom see LICENSE.md",
"cordova": {
"platforms": [
- "android",
- "ios"
+ "ios",
+ "android"
],
"plugins": {
"cordova-plugin-customurlscheme": {
@@ -22,11 +22,9 @@
"cordova-plugin-insomnia": {},
"cordova-plugin-pin-dialog": {},
"cordova-plugin-whitelist": {},
- "cordova-sqlite-storage": {},
"cordova-plugin-android-fingerprint-auth": {},
"cordova-plugin-network-information": {},
"cordova-plugin-device": {},
- "cordova-plugin-file": {},
"cordova-library-helper-pp-fork": {},
"cordova-plugin-multi-window": {},
"cordova-plugin-ignore-lint-translation": {},
@@ -36,15 +34,7 @@
"cordova-custom-config": {},
"cordova-plugin-advanced-websocket": {},
"cordova-plugin-splashscreen": {},
- "cordova-plugin-add-swift-support": {},
- "cordova-plugin-photo-library": {
- "PHOTO_LIBRARY_USAGE_DESCRIPTION": "Save monitor photos to albums"
- },
"cordova-support-google-services": {},
- "phonegap-plugin-push": {
- "ANDROID_SUPPORT_V13_VERSION": "27.+",
- "FCM_VERSION": "17.0.+"
- },
"cordova-plugin-x-socialsharing": {
"ANDROID_SUPPORT_V4_VERSION": "24.1.1+",
"PHOTO_LIBRARY_ADD_USAGE_DESCRIPTION": "This app requires photo library access to function properly.",
@@ -55,31 +45,48 @@
"FACEID_USAGE_DESCRIPTION": ""
},
"cordova-plugin-android-permissions": {},
- "cordova-plugin-inappbrowser": {},
"cordova-plugin-app-version": {},
- "cordova-plugin-statusbar-pp-fork": {},
+ "cordova-sqlite-storage": {},
+ "cordova-plugin-add-swift-support": {},
"cordova-plugin-statusbar": {},
- "cordova-plugin-advanced-http": {
- "OKHTTP_VERSION": "3.10.0"
+ "cordova-plugin-file": {},
+ "cordova-plugin-photo-library-wkwebview": {
+ "PHOTO_LIBRARY_USAGE_DESCRIPTION": "Save alarmed images to phone "
},
- "cordova-plugin-ionic-webview": {
- "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
+ "cordova-plugin-firebasex": {
+ "FIREBASE_ANALYTICS_COLLECTION_ENABLED": "false",
+ "FIREBASE_PERFORMANCE_COLLECTION_ENABLED": "false",
+ "FIREBASE_CRASHLYTICS_COLLECTION_ENABLED": "false",
+ "ANDROID_ICON_ACCENT": "#FF00FFFF",
+ "ANDROID_PLAY_SERVICES_AUTH_VERSION": "18.0.0",
+ "ANDROID_FIREBASE_ANALYTICS_VERSION": "17.4.3",
+ "ANDROID_FIREBASE_MESSAGING_VERSION": "20.2.1",
+ "ANDROID_FIREBASE_CONFIG_VERSION": "19.1.4",
+ "ANDROID_FIREBASE_PERF_VERSION": "19.0.7",
+ "ANDROID_FIREBASE_AUTH_VERSION": "19.3.1",
+ "ANDROID_FIREBASE_FIRESTORE_VERSION": "21.4.3",
+ "ANDROID_FIREBASE_CRASHLYTICS_VERSION": "17.0.1",
+ "ANDROID_FIREBASE_CRASHLYTICS_NDK_VERSION": "17.0.1",
+ "ANDROID_GSON_VERSION": "2.8.6"
},
- "cordova-plugin-media-pp-fork": {}
+ "cordova-plugin-media-pp-fork": {},
+ "cordova-plugin-advanced-http": {}
}
},
"dependencies": {
"async": "^3.2.0",
"clivas": "^0.2.0",
- "cordova-android": "^8.0.0",
+ "cordova-android": "^8.1.0",
"cordova-custom-config": "^5.1.0",
- "cordova-ios": "^4.5.5",
+ "cordova-ios": "^5.1.1",
"cordova-library-helper-pp-fork": "^1.0.1",
- "cordova-plugin-add-swift-support": "^1.7.2",
- "cordova-plugin-advanced-http": "^2.5.1",
+ "cordova-plugin-add-swift-support": "^2.0.2",
+ "cordova-plugin-advanced-http": "3.0.1",
"cordova-plugin-advanced-websocket": "^1.1.5",
"cordova-plugin-android-fingerprint-auth": "^1.5.0",
"cordova-plugin-android-permissions": "^1.0.2",
+ "cordova-plugin-androidx": "^2.0.0",
+ "cordova-plugin-androidx-adapter": "^1.1.1",
"cordova-plugin-app-version": "^0.1.9",
"cordova-plugin-cloud-settings": "^1.0.4",
"cordova-plugin-customurlscheme": "^4.4.0",
@@ -88,21 +95,19 @@
"cordova-plugin-file-transfer": "^1.7.1",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-ignore-lint-translation": "0.0.1",
- "cordova-plugin-inappbrowser": "git+https://github.com/apache/cordova-plugin-inappbrowser.git",
"cordova-plugin-insomnia": "^4.3.0",
"cordova-plugin-ionic-keyboard": "^2.2.0",
- "cordova-plugin-ionic-webview": "git+https://github.com/pliablepixels/cordova-plugin-ionic-webview.git",
"cordova-plugin-media-pp-fork": "^1.0.2-dev",
"cordova-plugin-multi-window": "0.0.3",
"cordova-plugin-network-information": "^2.0.2",
- "cordova-plugin-photo-library": "git+https://github.com/pliablepixels/cordova-plugin-photo-library.git",
+ "cordova-plugin-photo-library-wkwebview": "^3.0.3",
"cordova-plugin-pin-dialog": "^0.1.3",
"cordova-plugin-splashscreen": "git+https://github.com/prageeth/cordova-plugin-splashscreen.git",
"cordova-plugin-statusbar-pp-fork": "^2.4.4-dev",
"cordova-plugin-touch-id": "^3.4.0",
"cordova-plugin-whitelist": "^1.3.4",
"cordova-plugin-x-socialsharing": "^5.6.4",
- "cordova-sqlite-storage": "^1.5.3",
+ "cordova-sqlite-storage": "^5.0.1",
"cordova-support-google-services": "^1.3.2",
"deep-equal": "^2.0.3",
"define-properties": "^1.1.3",
@@ -121,19 +126,19 @@
"json-file": "^0.1.0",
"jsonfile": "^6.0.1",
"keypress": "^0.2.1",
+ "latest": "^0.2.0",
"menu": "^0.2.5",
"minimist": "^1.2.5",
"mkdirp": "^1.0.4",
"node-sass": "^4.14.1",
"object-is": "^1.1.2",
"object-keys": "^1.1.1",
- "phonegap-plugin-multidex": "^1.0.0",
- "phonegap-plugin-push": "^2.3.0",
"regexp.prototype.flags": "^1.3.0"
},
"devDependencies": {
"@ionic/v1-toolkit": "^1.0.14",
"bower": "^1.8.4",
+ "cordova-plugin-firebasex": "^10.2.0-cli",
"dotenv": "^8.2.0",
"electron": "^8.3.0",
"electron-builder": "^22.6.0",
diff --git a/resources/android/icon/drawable-hdpi-icon.png b/resources/android/icon/drawable-hdpi-icon.png
index bc34de04..98f749e3 100644
--- a/resources/android/icon/drawable-hdpi-icon.png
+++ b/resources/android/icon/drawable-hdpi-icon.png
Binary files differ
diff --git a/resources/android/icon/drawable-ldpi-icon.png b/resources/android/icon/drawable-ldpi-icon.png
index 8503e20a..ac678aff 100644
--- a/resources/android/icon/drawable-ldpi-icon.png
+++ b/resources/android/icon/drawable-ldpi-icon.png
Binary files differ
diff --git a/resources/android/icon/drawable-mdpi-icon.png b/resources/android/icon/drawable-mdpi-icon.png
index caa7eb35..623adc16 100644
--- a/resources/android/icon/drawable-mdpi-icon.png
+++ b/resources/android/icon/drawable-mdpi-icon.png
Binary files differ
diff --git a/resources/android/icon/drawable-xhdpi-icon.png b/resources/android/icon/drawable-xhdpi-icon.png
index 2baf9d3e..05ebcc91 100644
--- a/resources/android/icon/drawable-xhdpi-icon.png
+++ b/resources/android/icon/drawable-xhdpi-icon.png
Binary files differ
diff --git a/resources/android/icon/drawable-xxhdpi-icon.png b/resources/android/icon/drawable-xxhdpi-icon.png
index f41b44df..90ddf934 100644
--- a/resources/android/icon/drawable-xxhdpi-icon.png
+++ b/resources/android/icon/drawable-xxhdpi-icon.png
Binary files differ
diff --git a/resources/android/icon/drawable-xxxhdpi-icon.png b/resources/android/icon/drawable-xxxhdpi-icon.png
index 13f4aee1..9e62dcff 100644
--- a/resources/android/icon/drawable-xxxhdpi-icon.png
+++ b/resources/android/icon/drawable-xxxhdpi-icon.png
Binary files differ
diff --git a/resources/android/splash/drawable-land-hdpi-screen.png b/resources/android/splash/drawable-land-hdpi-screen.png
index 058f23ee..0874c68a 100644
--- a/resources/android/splash/drawable-land-hdpi-screen.png
+++ b/resources/android/splash/drawable-land-hdpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-land-ldpi-screen.png b/resources/android/splash/drawable-land-ldpi-screen.png
index 97156662..15657f17 100644
--- a/resources/android/splash/drawable-land-ldpi-screen.png
+++ b/resources/android/splash/drawable-land-ldpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-land-mdpi-screen.png b/resources/android/splash/drawable-land-mdpi-screen.png
index 88346233..fdcda718 100644
--- a/resources/android/splash/drawable-land-mdpi-screen.png
+++ b/resources/android/splash/drawable-land-mdpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-land-xhdpi-screen.png b/resources/android/splash/drawable-land-xhdpi-screen.png
index e5de99ff..f1d848bb 100644
--- a/resources/android/splash/drawable-land-xhdpi-screen.png
+++ b/resources/android/splash/drawable-land-xhdpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-land-xxhdpi-screen.png b/resources/android/splash/drawable-land-xxhdpi-screen.png
index 72a2c870..13b7763a 100644
--- a/resources/android/splash/drawable-land-xxhdpi-screen.png
+++ b/resources/android/splash/drawable-land-xxhdpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-land-xxxhdpi-screen.png b/resources/android/splash/drawable-land-xxxhdpi-screen.png
index aac9b067..fed39e1a 100644
--- a/resources/android/splash/drawable-land-xxxhdpi-screen.png
+++ b/resources/android/splash/drawable-land-xxxhdpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-port-hdpi-screen.png b/resources/android/splash/drawable-port-hdpi-screen.png
index ea652835..6403ab4d 100644
--- a/resources/android/splash/drawable-port-hdpi-screen.png
+++ b/resources/android/splash/drawable-port-hdpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-port-ldpi-screen.png b/resources/android/splash/drawable-port-ldpi-screen.png
index 5dce2cbf..ca9813a4 100644
--- a/resources/android/splash/drawable-port-ldpi-screen.png
+++ b/resources/android/splash/drawable-port-ldpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-port-mdpi-screen.png b/resources/android/splash/drawable-port-mdpi-screen.png
index 9362bd78..dc1e381d 100644
--- a/resources/android/splash/drawable-port-mdpi-screen.png
+++ b/resources/android/splash/drawable-port-mdpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-port-xhdpi-screen.png b/resources/android/splash/drawable-port-xhdpi-screen.png
index 574e15f1..5f0e8637 100644
--- a/resources/android/splash/drawable-port-xhdpi-screen.png
+++ b/resources/android/splash/drawable-port-xhdpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-port-xxhdpi-screen.png b/resources/android/splash/drawable-port-xxhdpi-screen.png
index 87e565d2..4a2f9c94 100644
--- a/resources/android/splash/drawable-port-xxhdpi-screen.png
+++ b/resources/android/splash/drawable-port-xxhdpi-screen.png
Binary files differ
diff --git a/resources/android/splash/drawable-port-xxxhdpi-screen.png b/resources/android/splash/drawable-port-xxxhdpi-screen.png
index 17fbf11f..622eeeb2 100644
--- a/resources/android/splash/drawable-port-xxxhdpi-screen.png
+++ b/resources/android/splash/drawable-port-xxxhdpi-screen.png
Binary files differ
diff --git a/resources/ios/icon/icon-1024.png b/resources/ios/icon/icon-1024.png
index ac9c40bd..846342e1 100644
--- a/resources/ios/icon/icon-1024.png
+++ b/resources/ios/icon/icon-1024.png
Binary files differ
diff --git a/resources/ios/icon/icon-108@2x.png b/resources/ios/icon/icon-108@2x.png
new file mode 100644
index 00000000..ff121226
--- /dev/null
+++ b/resources/ios/icon/icon-108@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-20.png b/resources/ios/icon/icon-20.png
new file mode 100644
index 00000000..26a3d4c7
--- /dev/null
+++ b/resources/ios/icon/icon-20.png
Binary files differ
diff --git a/resources/ios/icon/icon-20@2x.png b/resources/ios/icon/icon-20@2x.png
new file mode 100644
index 00000000..4e264e62
--- /dev/null
+++ b/resources/ios/icon/icon-20@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-20@3x.png b/resources/ios/icon/icon-20@3x.png
new file mode 100644
index 00000000..4e38a90a
--- /dev/null
+++ b/resources/ios/icon/icon-20@3x.png
Binary files differ
diff --git a/resources/ios/icon/icon-24@2x.png b/resources/ios/icon/icon-24@2x.png
new file mode 100644
index 00000000..60c39c08
--- /dev/null
+++ b/resources/ios/icon/icon-24@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-27.5@2x.png b/resources/ios/icon/icon-27.5@2x.png
new file mode 100644
index 00000000..89013dac
--- /dev/null
+++ b/resources/ios/icon/icon-27.5@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-29.png b/resources/ios/icon/icon-29.png
new file mode 100644
index 00000000..a6e4dcaa
--- /dev/null
+++ b/resources/ios/icon/icon-29.png
Binary files differ
diff --git a/resources/ios/icon/icon-29@2x.png b/resources/ios/icon/icon-29@2x.png
new file mode 100644
index 00000000..a0692d82
--- /dev/null
+++ b/resources/ios/icon/icon-29@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-29@3x.png b/resources/ios/icon/icon-29@3x.png
new file mode 100644
index 00000000..17829fc9
--- /dev/null
+++ b/resources/ios/icon/icon-29@3x.png
Binary files differ
diff --git a/resources/ios/icon/icon-40.png b/resources/ios/icon/icon-40.png
index 48dbac42..4e264e62 100644
--- a/resources/ios/icon/icon-40.png
+++ b/resources/ios/icon/icon-40.png
Binary files differ
diff --git a/resources/ios/icon/icon-40@2x.png b/resources/ios/icon/icon-40@2x.png
index c693e052..fa9d0da4 100644
--- a/resources/ios/icon/icon-40@2x.png
+++ b/resources/ios/icon/icon-40@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-40@3x.png b/resources/ios/icon/icon-40@3x.png
index 3b239f29..dcefaa13 100644
--- a/resources/ios/icon/icon-40@3x.png
+++ b/resources/ios/icon/icon-40@3x.png
Binary files differ
diff --git a/resources/ios/icon/icon-44@2x.png b/resources/ios/icon/icon-44@2x.png
new file mode 100644
index 00000000..983911d1
--- /dev/null
+++ b/resources/ios/icon/icon-44@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-50.png b/resources/ios/icon/icon-50.png
index a5223f19..03de6b8f 100644
--- a/resources/ios/icon/icon-50.png
+++ b/resources/ios/icon/icon-50.png
Binary files differ
diff --git a/resources/ios/icon/icon-50@2x.png b/resources/ios/icon/icon-50@2x.png
index 3c3711e7..2abe6c8e 100644
--- a/resources/ios/icon/icon-50@2x.png
+++ b/resources/ios/icon/icon-50@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-60.png b/resources/ios/icon/icon-60.png
index 9508abb3..4e38a90a 100644
--- a/resources/ios/icon/icon-60.png
+++ b/resources/ios/icon/icon-60.png
Binary files differ
diff --git a/resources/ios/icon/icon-60@2x.png b/resources/ios/icon/icon-60@2x.png
index 931218ca..dcefaa13 100644
--- a/resources/ios/icon/icon-60@2x.png
+++ b/resources/ios/icon/icon-60@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-60@3x.png b/resources/ios/icon/icon-60@3x.png
index 093a15ac..75986d26 100644
--- a/resources/ios/icon/icon-60@3x.png
+++ b/resources/ios/icon/icon-60@3x.png
Binary files differ
diff --git a/resources/ios/icon/icon-72.png b/resources/ios/icon/icon-72.png
index e85815d0..ee89eac9 100644
--- a/resources/ios/icon/icon-72.png
+++ b/resources/ios/icon/icon-72.png
Binary files differ
diff --git a/resources/ios/icon/icon-72@2x.png b/resources/ios/icon/icon-72@2x.png
index 9a924ac4..6f2b90e0 100644
--- a/resources/ios/icon/icon-72@2x.png
+++ b/resources/ios/icon/icon-72@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-76.png b/resources/ios/icon/icon-76.png
index 6839b447..e378d582 100644
--- a/resources/ios/icon/icon-76.png
+++ b/resources/ios/icon/icon-76.png
Binary files differ
diff --git a/resources/ios/icon/icon-76@2x.png b/resources/ios/icon/icon-76@2x.png
index 3591840e..511b0bb7 100644
--- a/resources/ios/icon/icon-76@2x.png
+++ b/resources/ios/icon/icon-76@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-83.5@2x.png b/resources/ios/icon/icon-83.5@2x.png
index 85ddc4f6..e7a875b2 100644
--- a/resources/ios/icon/icon-83.5@2x.png
+++ b/resources/ios/icon/icon-83.5@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-86@2x.png b/resources/ios/icon/icon-86@2x.png
new file mode 100644
index 00000000..86c15b67
--- /dev/null
+++ b/resources/ios/icon/icon-86@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon-98@2x.png b/resources/ios/icon/icon-98@2x.png
new file mode 100644
index 00000000..d85e6236
--- /dev/null
+++ b/resources/ios/icon/icon-98@2x.png
Binary files differ
diff --git a/resources/ios/icon/icon.png b/resources/ios/icon/icon.png
index d7fe6ed8..af08c4d7 100644
--- a/resources/ios/icon/icon.png
+++ b/resources/ios/icon/icon.png
Binary files differ
diff --git a/resources/ios/icon/icon@2x.png b/resources/ios/icon/icon@2x.png
index 1ba03a66..7123f4c7 100644
--- a/resources/ios/icon/icon@2x.png
+++ b/resources/ios/icon/icon@2x.png
Binary files differ
diff --git a/resources/ios/splash/Default-1792h~iphone.png b/resources/ios/splash/Default-1792h~iphone.png
new file mode 100644
index 00000000..720adbeb
--- /dev/null
+++ b/resources/ios/splash/Default-1792h~iphone.png
Binary files differ
diff --git a/resources/ios/splash/Default-2436h.png b/resources/ios/splash/Default-2436h.png
new file mode 100644
index 00000000..a7f8bac9
--- /dev/null
+++ b/resources/ios/splash/Default-2436h.png
Binary files differ
diff --git a/resources/ios/splash/Default-2688h~iphone.png b/resources/ios/splash/Default-2688h~iphone.png
new file mode 100644
index 00000000..1658e06c
--- /dev/null
+++ b/resources/ios/splash/Default-2688h~iphone.png
Binary files differ
diff --git a/resources/ios/splash/Default-568h@2x~iphone.png b/resources/ios/splash/Default-568h@2x~iphone.png
index ce05fea7..48af4cdc 100644
--- a/resources/ios/splash/Default-568h@2x~iphone.png
+++ b/resources/ios/splash/Default-568h@2x~iphone.png
Binary files differ
diff --git a/resources/ios/splash/Default-667h.png b/resources/ios/splash/Default-667h.png
index fdc77c8b..2139d119 100644
--- a/resources/ios/splash/Default-667h.png
+++ b/resources/ios/splash/Default-667h.png
Binary files differ
diff --git a/resources/ios/splash/Default-736h.png b/resources/ios/splash/Default-736h.png
index 94c20a11..9b474ce4 100644
--- a/resources/ios/splash/Default-736h.png
+++ b/resources/ios/splash/Default-736h.png
Binary files differ
diff --git a/resources/ios/splash/Default-Landscape-1792h~iphone.png b/resources/ios/splash/Default-Landscape-1792h~iphone.png
new file mode 100644
index 00000000..ea1595f9
--- /dev/null
+++ b/resources/ios/splash/Default-Landscape-1792h~iphone.png
Binary files differ
diff --git a/resources/ios/splash/Default-Landscape-2436h.png b/resources/ios/splash/Default-Landscape-2436h.png
new file mode 100644
index 00000000..99f34d2a
--- /dev/null
+++ b/resources/ios/splash/Default-Landscape-2436h.png
Binary files differ
diff --git a/resources/ios/splash/Default-Landscape-2688h~iphone.png b/resources/ios/splash/Default-Landscape-2688h~iphone.png
new file mode 100644
index 00000000..c5e018cd
--- /dev/null
+++ b/resources/ios/splash/Default-Landscape-2688h~iphone.png
Binary files differ
diff --git a/resources/ios/splash/Default-Landscape-736h.png b/resources/ios/splash/Default-Landscape-736h.png
index 432df0f0..a3101bb0 100644
--- a/resources/ios/splash/Default-Landscape-736h.png
+++ b/resources/ios/splash/Default-Landscape-736h.png
Binary files differ
diff --git a/resources/ios/splash/Default-Landscape@2x~ipad.png b/resources/ios/splash/Default-Landscape@2x~ipad.png
index 66fb291b..387fb032 100644
--- a/resources/ios/splash/Default-Landscape@2x~ipad.png
+++ b/resources/ios/splash/Default-Landscape@2x~ipad.png
Binary files differ
diff --git a/resources/ios/splash/Default-Landscape@~ipadpro.png b/resources/ios/splash/Default-Landscape@~ipadpro.png
index 617d89af..f1c07d85 100644
--- a/resources/ios/splash/Default-Landscape@~ipadpro.png
+++ b/resources/ios/splash/Default-Landscape@~ipadpro.png
Binary files differ
diff --git a/resources/ios/splash/Default-Landscape~ipad.png b/resources/ios/splash/Default-Landscape~ipad.png
index 08cbe4f5..97a83a5e 100644
--- a/resources/ios/splash/Default-Landscape~ipad.png
+++ b/resources/ios/splash/Default-Landscape~ipad.png
Binary files differ
diff --git a/resources/ios/splash/Default-Portrait@2x~ipad.png b/resources/ios/splash/Default-Portrait@2x~ipad.png
index 1ccb59ba..7e0fd1e4 100644
--- a/resources/ios/splash/Default-Portrait@2x~ipad.png
+++ b/resources/ios/splash/Default-Portrait@2x~ipad.png
Binary files differ
diff --git a/resources/ios/splash/Default-Portrait@~ipadpro.png b/resources/ios/splash/Default-Portrait@~ipadpro.png
index a89e035e..5e0af58d 100644
--- a/resources/ios/splash/Default-Portrait@~ipadpro.png
+++ b/resources/ios/splash/Default-Portrait@~ipadpro.png
Binary files differ
diff --git a/resources/ios/splash/Default-Portrait~ipad.png b/resources/ios/splash/Default-Portrait~ipad.png
index f14523b7..f15bdeb8 100644
--- a/resources/ios/splash/Default-Portrait~ipad.png
+++ b/resources/ios/splash/Default-Portrait~ipad.png
Binary files differ
diff --git a/resources/ios/splash/Default@2x~iphone.png b/resources/ios/splash/Default@2x~iphone.png
index 4a416180..9ee6a125 100644
--- a/resources/ios/splash/Default@2x~iphone.png
+++ b/resources/ios/splash/Default@2x~iphone.png
Binary files differ
diff --git a/resources/ios/splash/Default@2x~universal~anyany.png b/resources/ios/splash/Default@2x~universal~anyany.png
index e3c3a88a..ad4725d1 100644
--- a/resources/ios/splash/Default@2x~universal~anyany.png
+++ b/resources/ios/splash/Default@2x~universal~anyany.png
Binary files differ
diff --git a/resources/ios/splash/Default~iphone.png b/resources/ios/splash/Default~iphone.png
index 1c8331a6..dc1e381d 100644
--- a/resources/ios/splash/Default~iphone.png
+++ b/resources/ios/splash/Default~iphone.png
Binary files differ
diff --git a/www/js/EventCtrl.js b/www/js/EventCtrl.js
index 40762f6b..a6e89d6c 100644
--- a/www/js/EventCtrl.js
+++ b/www/js/EventCtrl.js
@@ -2475,25 +2475,23 @@ angular.module('zmApp.controllers')
$scope.popover = popover;
});
+ // coming to this view clears all notification badges
EventServer.sendMessage('push', {
type: 'badge',
badge: 0,
});
+ // also clear bells
+ $rootScope.alarmCount = "0";
+ $rootScope.isAlarm = 0;
-
-
- //reset badge count
- if (window.cordova && window.cordova.plugins.notification) {
- $cordovaBadge.set(0).then(function () {
- // You have permission, badge set.
- }, function (err) {
- NVR.debug("app does not have badge permissions. Please check your phone notification settings");
- // You do not have permission.
- });
+ // reset badge count
+ if (window.FirebasePlugin && $rootScope.platformOS == 'ios') {
+ NVR.debug ('Clearing app badge count');
+ window.FirebasePlugin.setBadgeNumber(0);
- $cordovaLocalNotification.clearAll();
}
-
+
+
});
$scope.$on('$ionicView.leave', function () {
diff --git a/www/js/EventServer.js b/www/js/EventServer.js
index 20642c1c..84260072 100644
--- a/www/js/EventServer.js
+++ b/www/js/EventServer.js
@@ -1,7 +1,7 @@
/* jshint -W041 */
/* jslint browser: true*/
-/* global cordova,StatusBar,angular,console ,PushNotification*/
+/* global cordova,StatusBar,angular,console ,PushNotification, FirebasePlugin*/
//--------------------------------------------------------------------------
// This factory interacts with the ZM Event Server
@@ -51,7 +51,7 @@ angular.module('zmApp.controllers')
if ($rootScope.apnsToken != '') {
- var plat = $ionicPlatform.is('ios') ? 'ios' : 'android';
+ // var plat = $ionicPlatform.is('ios') ? 'ios' : 'android';
var ld = NVR.getLogin();
var pushstate = "enabled";
if (ld.disablePush == true)
@@ -65,7 +65,7 @@ angular.module('zmApp.controllers')
sendMessage("push", {
type: 'token',
- platform: plat,
+ platform: $rootScope.platformOS,
token: $rootScope.apnsToken,
monlist: $rootScope.monstring,
intlist: $rootScope.intstring,
@@ -410,7 +410,8 @@ angular.module('zmApp.controllers')
var msg = {
'event': type,
- 'data': obj
+ 'data': obj,
+ 'token': $rootScope.apnsToken
};
var jmsg = JSON.stringify(msg);
@@ -435,6 +436,12 @@ angular.module('zmApp.controllers')
return;
}
+ if (($rootScope.platformOS != 'desktop') && (!$rootScope.apnsToken) ) {
+ NVR.debug ('Mobile platform does not have a token yet, adding message to queue');
+ pendingMessages.push ({type:type, obj:obj});
+ return;
+ }
+
if (authState == connState.REJECT && type != 'auth') {
NVR.debug ("EventSever: ERROR: ES rejected authentication, not sending message");
return;
@@ -510,6 +517,7 @@ angular.module('zmApp.controllers')
}*/
}
+
function pushInit() {
NVR.log("EventSever: Setting up push registration");
@@ -522,13 +530,194 @@ angular.module('zmApp.controllers')
var plat = $rootScope.platformOS;
if ($rootScope.platformOS == 'desktop') {
- NVR.log ('Not setting up push as this is desktop.');
+ NVR.log ('push: Not setting up push as this is desktop.');
return;
}
+
+ // get permission if we need it
+ FirebasePlugin.hasPermission(function(hasPermission){
+ if (!hasPermission) {
+ window.FirebasePlugin.grantPermission(function(hasPermission){
+ if (hasPermission) {
+ NVR.debug ('push: permission granted, waiting for token');
+ } else {
+ NVR.log('ERROR: push: Permission not granted for push');
+ }
+ });
+ } else {
+ NVR.debug('push: permissions are already enabled');
+ }
+ });
+
+ if ($rootScope.platformOS == 'android') {
+ // Define custom channel - all keys are except 'id' are optional.
+ var channel = {
+ // channel ID - must be unique per app package
+ id: "zmninja",
+ // Channel description. Default: empty string
+ description: "zmNinja push",
+ // Channel name. Default: empty string
+ name: "zmNinja",
+ //The sound to play once a push comes. Default value: 'default'
+ //Values allowed:
+ //'default' - plays the default notification sound
+ //'ringtone' - plays the currently set ringtone
+ //'false' - silent; don't play any sound
+ //filename - the filename of the sound file located in '/res/raw' without file extension (mysound.mp3 -> mysound)
+ sound: "default",
+
+ //Vibrate on new notification. Default value: true
+ //Possible values:
+ //Boolean - vibrate or not
+ //Array - vibration pattern - e.g. [500, 200, 500] - milliseconds vibrate, milliseconds pause, vibrate, pause, etc.
+ vibration: true,
+ // Whether to blink the LED
+ light: true,
+ //LED color in ARGB format - this example BLUE color. If set to -1, light color will be default. Default value: -1.
+ lightColor: parseInt("FF0000FF", 16).toString(),
+ //Importance - integer from 0 to 4. Default value: 4
+ //0 - none - no sound, does not show in the shade
+ //1 - min - no sound, only shows in the shade, below the fold
+ //2 - low - no sound, shows in the shade, and potentially in the status bar
+ //3 - default - shows everywhere, makes noise, but does not visually intrude
+ //4 - high - shows everywhere, makes noise and peeks
+ importance: 4,
+
+ //Show badge over app icon when non handled pushes are present. Default value: true
+ badge: true,
+
+ //Show message on locked screen. Default value: 1
+ //Possible values (default 1):
+ //-1 - secret - Do not reveal any part of the notification on a secure lockscreen.
+ //0 - private - Show the notification on all lockscreens, but conceal sensitive or private information on secure lockscreens.
+ //1 - public - Show the notification in its entirety on all lockscreens.
+ visibility: 1
+ };
+
+ // Create the channel
+ FirebasePlugin.createChannel(channel,
+ function(){
+ NVR.debug('push: Channel created: ' + channel.id);
+ },
+ function(error){
+ NVR.debug('push: Create channel error: ' + error);
+ });
+ }
+
+
+ if ($rootScope.platformOS == 'ios') {
+ if (ld.isUseEventServer) {
+ NVR.debug ('push: ios, setting badge alarm count at start');
+ window.FirebasePlugin.getBadgeNumber(function(cnt) {
+ if (cnt) {
+ NVR.debug ('push: ios, badge is:'+cnt);
+ $rootScope.isAlarm = 1;
+ $rootScope.alarmCount = cnt;
+ if ($rootScope.alarmCount > 99) {
+ $rootScope.alarmCount = '99+';
+ }
+ }
+ });
+ }
+ } // ios
+ // called when token is assigned
+ window.FirebasePlugin.onTokenRefresh(
+ function (token) {
+ NVR.debug ("push: got token:"+token);
+ $rootScope.apnsToken = token;
+ NVR.debug ('push: setting up onMessageReceived...');
+ window.FirebasePlugin.onMessageReceived(function(message) {
+ $ionicPlatform.ready(function () {
+
+ NVR.debug("push: EventSever: received push notification with payload:"+JSON.stringify(message));
+
+ if ($rootScope.platformOS == 'ios') {
+ NVR.debug ("push: clearing badge");
+ window.FirebasePlugin.setBadgeNumber(0);
+ }
+
+ var ld = NVR.getLogin();
+ if (ld.isUseEventServer == false) {
+ NVR.debug("push: EventSever: received push notification, but event server disabled. Not acting on it");
+ return;
+ }
+ NVR.debug ('push: Message type received is:'+message.messageType);
+
+ sendMessage('push', {
+ type: 'badge',
+ badge: 0,
+ });
+ var mid;
+ var eid = message.eid;
+ if (message.mid) {
+ mid = message.mid;
+ var mi = mid.indexOf(',');
+ if (mi > 0) {
+ mid = mid.slice(0, mi);
+ }
+ mid = parseInt(mid);
+ }
+
+
+ if (message.tap=='foreground') {
+ console.log ('push: Foreground');
+ $rootScope.tappedNotification = 0;
+ $rootScope.tappedEid = 0;
+ $rootScope.tappedMid = 0;
+
+ if (ld.soundOnPush) {
+ media.play({
+ playAudioWhenScreenIsLocked: false
+ });
+ }
+ if ($rootScope.alarmCount == "99") {
+ $rootScope.alarmCount = "99+";
+ }
+ if ($rootScope.alarmCount != "99+") {
+ $rootScope.alarmCount = (parseInt($rootScope.alarmCount) + 1).toString();
+ }
+ $rootScope.isAlarm = 1;
+
+
+
+ } else if (message.tap == 'background') {
+ $rootScope.alarmCount = "0";
+ $rootScope.isAlarm = 0;
+ $rootScope.tappedNotification = 1;
+ $rootScope.tappedMid = mid;
+ $rootScope.tappedEid = eid;
+ NVR.log("EventSever: Push notification: Tapped Monitor taken as:" + $rootScope.tappedMid);
+
+ $timeout ( function () {
+ NVR.debug ("EventServer: broadcasting process-push");
+ $rootScope.$broadcast('process-push');
+ },100);
+
+
+ } else {
+ NVR.debug ("push: message tap not defined");
+ $rootScope.tappedNotification = 0;
+ $rootScope.tappedEid = 0;
+ $rootScope.tappedMid = 0;
+
+ }
+
+ }); // ready
+ });
+ },
+ function (err) {
+ NVR.debug ('push: Error getting token:'+err);
+
+ });
+
+
+
+
+
if (plat == 'ios') {
mediasrc = "sounds/blop.mp3";
- push = PushNotification.init(
+ /* push = PushNotification.init(
{
"ios": {
@@ -541,13 +730,13 @@ angular.module('zmApp.controllers')
}
}
- );
+ );*/
} else {
mediasrc = "/android_asset/www/sounds/blop.mp3";
var android_media_file = "blop";
- push = PushNotification.init(
+ /* push = PushNotification.init(
{
"android": {
@@ -559,15 +748,15 @@ angular.module('zmApp.controllers')
}
}
- );
+ );*/
}
- PushNotification.hasPermission(function (succ) {
+ /* 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);
try {
@@ -578,7 +767,7 @@ angular.module('zmApp.controllers')
}
-
+ /*
push.on('registration', function (data) {
pushInited = true;
NVR.debug("EventSever: Push Notification registration ID received: " + JSON.stringify(data));
@@ -640,136 +829,10 @@ angular.module('zmApp.controllers')
NVR.log("EventSever: Could not get monitors, can't send push reg");
});
- });
-
- push.on('notification', function (data) {
-
- $ionicPlatform.ready(function () {
- NVR.log("EventSever: notification handler device ready");
- NVR.debug("EventSever: received push notification");
-
- var ld = NVR.getLogin();
- if (ld.isUseEventServer == false) {
- NVR.debug("EventSever: received push notification, but event server disabled. Not acting on it");
- return;
- }
-
- if (data && data.additionalData && data.additionalData.foreground == false) {
- // This means push notification tap in background
-
- NVR.debug("EventSever: PUSH NOTF >>> " + JSON.stringify(data));
-
- // set tappedMid to monitor
- //*** PUSH DATA>>>>{"sound":"blop","message":"Alarms: Basement (2854) ","additionalData":{"mid":"2","coldstart":false,"collapse_key":"do_not_collapse","foreground":false}}
-
- if (data.additionalData.dismissed != undefined || data.additionalData.coldstart == true || $rootScope.platformOS == 'ios') // user tapped on notification
- // in iOS case, since content-av is not there this notification won't be called unless you tap
- {
- NVR.debug("Notification Tapped");
- $rootScope.alarmCount = "0";
- $rootScope.isAlarm = 0;
- $rootScope.tappedNotification = 1;
-
- var mid;
- var eid;
-
- // we are using FCM on IOS too
- /* if ($rootScope.platformOS == 'ios') {
- mid = data.additionalData.gcm.notification.mid;
- eid = data.additionalData.gcm.notification.eid;
-
- }
- else {*/
-
- mid = data.additionalData.mid;
- eid = data.additionalData.eid;
- // }
-
-
-
- // if Multiple mids, take the first one
- if (mid) {
- var mi = mid.indexOf(',');
- if (mi > 0) {
- mid = mid.slice(0, mi);
- }
- }
-
- mid = parseInt(mid);
-
- $rootScope.tappedMid = mid;
- $rootScope.tappedEid = eid;
- NVR.log("EventSever: Push notification: Tapped Monitor taken as:" + $rootScope.tappedMid);
-
- if ($rootScope.platformOS == 'ios') {
-
- NVR.debug("EventSever: iOS only: clearing background push");
- push.finish(function () {
- NVR.debug("EventSever: processing of push data is finished");
- });
- }
-
- } else {
- NVR.debug("EventSever: App started via icon, not notification tap");
- $rootScope.tappedNotification = 0;
- $rootScope.tappedEid = 0;
- $rootScope.tappedMid = 0;
- }
- // keep this emit not broadcast
- // see Portal latch for reason
-
- //https://stackoverflow.com/a/22651128/1361529
- $timeout ( function () {
- NVR.debug ("EventServer: broadcasting process-push");
- $rootScope.$broadcast('process-push');
- },100);
-
-
- } else // app is foreground
- {
-
- // this flag honors the HW mute button. Go figure
- // http://ilee.co.uk/phonegap-plays-sound-on-mute/
-
- NVR.debug("EventSever: --> *** PUSH IN FOREGROUND");
-
- $rootScope.tappedNotification = 0;
- $rootScope.tappedEid = 0;
- $rootScope.tappedMid = 0;
-
- if (ld.soundOnPush) {
- media.play({
- playAudioWhenScreenIsLocked: false
- });
- }
-
- var str = data.message;
- // console.log ("***STRING: " + str + " " +str.status);
- var eventsToDisplay = [];
-
- NVR.displayBanner('alarm', [str], 0, 5000 * eventsToDisplay.length);
-
- $rootScope.isAlarm = 1;
-
- // Show upto a max of 99 when it comes to display
- // so aesthetics are maintained
- if ($rootScope.alarmCount == "99") {
- $rootScope.alarmCount = "99+";
- }
- if ($rootScope.alarmCount != "99+") {
- $rootScope.alarmCount = (parseInt($rootScope.alarmCount) + 1).toString();
- }
-
-
-
- }
- });
- });
-
- push.on('error', function (e) {
- NVR.debug("EventSever: Push error: " + JSON.stringify(e));
- // console.log("************* PUSH ERROR ******************");
- });
+ }); */
+
+ // add push code here
+
}
return {
diff --git a/www/js/NVR.js b/www/js/NVR.js
index 65a18dbc..f1c369c3 100644
--- a/www/js/NVR.js
+++ b/www/js/NVR.js
@@ -21,7 +21,7 @@ angular.module('zmApp.controllers')
DO NOT TOUCH zmAppVersion
It is changed by sync_version.sh
*/
- var zmAppVersion = "1.4.009";
+ var zmAppVersion = "1.5.000";
var isBackground = false;
var justResumed = false;
diff --git a/www/js/app.js b/www/js/app.js
index 26fef2fb..f84673a5 100755
--- a/www/js/app.js
+++ b/www/js/app.js
@@ -34,7 +34,7 @@ angular.module('zmApp', [
.constant('zm', {
minAppVersion: '1.28.107', // if ZM is less than this, the app won't work
//minAppVersion:'1.44',
- minEventServerVersion: '2.4',
+ minEventServerVersion: '6.0',
castAppId: 'BA30FB4C',
alarmFlashTimer: 20000, // time to flash alarm
gcmSenderId: '710936220256',