Skip to content

Commit

Permalink
#962 feature complete compared to push plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
pliablepixels committed Aug 28, 2020
1 parent 1c2ba2c commit 25211b7
Show file tree
Hide file tree
Showing 7 changed files with 275 additions and 179 deletions.
37 changes: 26 additions & 11 deletions config.xml
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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">
Expand All @@ -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>
Expand Down Expand Up @@ -85,7 +84,7 @@
<icon height="87" src="resources/ios/icon/[email protected]" 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" />
Expand All @@ -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/[email protected]" width="40" />
<icon height="60" src="resources/ios/icon/[email protected]" width="60" />
<icon height="29" src="resources/ios/icon/icon-29.png" width="29" />
<icon height="58" src="resources/ios/icon/[email protected]" width="58" />
<icon height="87" src="resources/ios/icon/[email protected]" width="87" />
<icon height="48" src="resources/ios/icon/[email protected]" width="48" />
<icon height="55" src="resources/ios/icon/[email protected]" width="55" />
<icon height="88" src="resources/ios/icon/[email protected]" width="88" />
<icon height="172" src="resources/ios/icon/[email protected]" width="172" />
<icon height="196" src="resources/ios/icon/[email protected]" width="196" />
<icon height="216" src="resources/ios/icon/[email protected]" 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" />
Expand Down Expand Up @@ -159,23 +176,21 @@
<plugin name="cordova-custom-config" spec="5.0.2" />
<plugin name="cordova-plugin-advanced-websocket" spec="1.1.5" />
<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-whitelist" spec="^1.3.4" />
<plugin name="cordova-plugin-advanced-http" spec="^2.5.1">
<variable name="OKHTTP_VERSION" value="3.10.0" />
</plugin>
</widget>
8 changes: 6 additions & 2 deletions docs/guides/source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -138,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:
Expand Down
40 changes: 28 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "zmninjapro",
"description": "Home security mobile app for ZoneMinder",
"version": "1.4.010",
"version": "1.5.000",
"displayName": "zmNinja",
"author": "Pliable Pixels",
"license": "custom see LICENSE.md",
Expand Down Expand Up @@ -35,10 +35,6 @@
"cordova-plugin-advanced-websocket": {},
"cordova-plugin-splashscreen": {},
"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.",
Expand All @@ -50,16 +46,33 @@
},
"cordova-plugin-android-permissions": {},
"cordova-plugin-app-version": {},
"cordova-plugin-advanced-http": {
"OKHTTP_VERSION": "3.10.0"
},
"cordova-sqlite-storage": {},
"cordova-plugin-add-swift-support": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-file": {},
"cordova-plugin-media-pp-fork": {},
"cordova-plugin-photo-library-wkwebview": {
"PHOTO_LIBRARY_USAGE_DESCRIPTION": "Save alarmed images to phone "
},
"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-advanced-http": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
}
}
},
Expand All @@ -71,10 +84,12 @@
"cordova-ios": "^5.1.1",
"cordova-library-helper-pp-fork": "^1.0.1",
"cordova-plugin-add-swift-support": "^2.0.2",
"cordova-plugin-advanced-http": "^2.5.1",
"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",
Expand All @@ -85,6 +100,7 @@
"cordova-plugin-ignore-lint-translation": "0.0.1",
"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",
Expand Down Expand Up @@ -114,19 +130,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",
Expand Down
22 changes: 10 additions & 12 deletions www/js/EventCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = !$rootScope.isAlarm;



//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 () {
Expand Down
Loading

0 comments on commit 25211b7

Please sign in to comment.