ZoneMinder / zmNinja

High performance, cross platform ionic app for Home/Commerical Security Surveillance using ZoneMinder
http://zmninja.zoneminder.com
Other
1.01k stars 268 forks source link

zmNinja complied from sources for Android and push notification #464

Closed tecufanujacu closed 7 years ago

tecufanujacu commented 7 years ago

I have just compiled zmNinja for Android from sources but I have a question, in your guide at step 5 there is this:

configure zmNinja for push notification (optional) If you want to enable zmNinja to receive push notification, you have to install the phonegap-plugin-push. cordova plugin add phonegap-plugin-push --variable SENDER_ID=XXXXX Where the XXXXXXX in SENDER_ID="XXXXXXX" maps to the project number in the Google Developer Console. If you are not creating an Android application you can put in anything for this value.

but If I don't have a SENDER_ID I can't use the push notifications, right? In this case if I start a new project to get a google SENDER_IT can then I use it without costs?

pliablepixels commented 7 years ago

To be honest, I'm not a 100% sure its needed. I added it because the plugin doc for push said so. I already have a sender ID in package.json - not sure which one is used. This entire ID and how it works if you compile yourself is not completely clear to me - feel free to try and let me know (But yes, GCM push is free) (see this if it helps)

tecufanujacu commented 7 years ago

Well, I have just configured your server and everything is working fabulously, thanks a lot for your work. The push notifications are working without problems but I don't know if they are working thanks to the WebSocket or to GCM, is there some way to check this? (and eventually sorry for the stupid question).

P.S.: I only have a little problem, sometime zmNinja crashes at exit, I'm on Android 6.0.1 (with cm13). From the logcat I can't see nothing, what could I do?(sorry for the OT)

pliablepixels commented 7 years ago

Ok great. To test that, you can kill the app from the task switcher and force a push. If it gets it, then its GCM

Not sure I can offer much perspective, especially if logcat is not showing anything about the crash on exit as it doesn't happen with me. However, when you say 'exit' what does that mean? Switching the app to the background, killing it via task bar or using the "exit" menu option?

tecufanujacu commented 7 years ago

Well GCM is working :-) I don't use gapps, I use microG and I can clearly see the app zmNinja registered for the push notifications, sorry for my previous questions, I had forgotten that I can see this from microG. Anyway I haven't set any SENDER_ID but I left the one that was present at build time.

About the crash at exit this happens when I press the exit button in the app and when I press the android back button, I have this problem on two phones, here the log:

02-24 00:58:52.835 I/ActivityManager(1452): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10300000 cmp=com.pliablepixels.zmninja_pro/.MainActivity bnds=[849,1339][1005,1495] (has extras)} from uid 10021 on display 0 02-24 00:58:52.878 I/ActivityManager(1452): Start proc 5493:com.pliablepixels.zmninja_pro/u0a66 for activity com.pliablepixels.zmninja_pro/.MainActivity 02-24 00:58:53.422 I/ActivityManager(1452): Displayed com.pliablepixels.zmninja_pro/.MainActivity: +555ms 02-24 00:59:06.430 W/ActivityManager(1452): Duplicate finish request for ActivityRecord{d765eaf u0 com.pliablepixels.zmninja_pro/.MainActivity t1977 f} 02-24 00:59:06.788 W/WindowManager(1452): Attempted to add application window with unknown token Token{699d2bc ActivityRecord{d765eaf u0 com.pliablepixels.zmninja_pro/.MainActivity t1977 f}}. Aborting. 02-24 00:59:06.904 F/libc (5493): Fatal signal 6 (SIGABRT), code -6 in tid 5493 (els.zmninja_pro) 02-24 00:59:07.006 F/DEBUG (255): pid: 5493, tid: 5493, name: els.zmninja_pro >>> com.pliablepixels.zmninja_pro <<< 02-24 00:59:07.869 I/ActivityManager(1452): Process com.pliablepixels.zmninja_pro (pid 5493) has died

Two questions:

pliablepixels commented 7 years ago

a) Battery - yes. If you are looking at montage, zmninja is essentially grabbing JPEG images every 2 seconds from your monitors. Try switching to "low bandwidth" mode

b) No, you don't need SSL certs - they are not related to notifications. they are for to SSL access to ZM and that too only if you enable strict SSL certs. Can you point me to the documentation that says you need it? I'll fix it

tecufanujacu commented 7 years ago

About the certificate, in this page: https://github.com/pliablepixels/zmeventserver

In the section SSL certificate:

Once that certificate is done, you also need to install it on your phone - thats as simple as emailing yourself the ".crt" file and double tapping it to install it.

About the crash the strange thing is that now this happens only on one phone, If you want I took a full log.

As second thing, I'm having problems with notifications, but for this I open a new issue.

pliablepixels commented 7 years ago

fixed the instruction page.