Page 4 of 5

Push notification services problem cause by device ID

Posted: Tue Dec 24, 2013 5:31 pm
by Bad Addy

Hello, its not working. Device Ready seems to not invoke any type of localStorage, as per screen shots:

This is the response I am getting:
Image

This is the code for the first Event when Device is ready.
Image

This is whats in the call for the request:
Image


Push notification services problem cause by device ID

Posted: Wed Dec 25, 2013 9:03 am
by Kateryna Grynko

Hi,

Do you run it on device or in desktop browser? What is your device OS version? Device ready won't work on browser.


Push notification services problem cause by device ID

Posted: Fri Dec 27, 2013 10:17 pm
by Bad Addy

its a emulator for Android, using 4.19 software. It does produce a device id, because its logged in the database when the app is installed.


Push notification services problem cause by device ID

Posted: Mon Dec 30, 2013 7:04 am
by Oleg Danchenkov

On the screen SignUpScreen please delete second action (Invoke service) on Device ready event.
Did you try it on real device?


Push notification services problem cause by device ID

Posted: Mon Dec 30, 2013 12:49 pm
by Bad Addy

I do not have a real Android phone to test it on. But I was assured that the SDK emulator would work like a real one to test the app.

I removed the second call, as requested, and tested the map again, and I am getting:

Image

I still do not get the console call that states the isDeviceRegistered was called, nor does it give the console part regarding the first JS call.


Push notification services problem cause by device ID

Posted: Tue Dec 31, 2013 7:39 am
by Illya Stepanov

Hi Bad, it could be the problem with the emulator, we'll test it on a device and we'll update you.


Push notification services problem cause by device ID

Posted: Tue Dec 31, 2013 2:00 pm
by Oleg Danchenkov

1) In mapping to deviceID parameter in service isDeviceRegistered
change
codevar deviceID = localStorage.getItem('uuID');/code
With
codevar deviceID = localStorage.getItem('pushNotificationDeviceID');/code
2) Your project works fine on real device (tested on Android 4.0.4)


Push notification services problem cause by device ID

Posted: Tue Mar 25, 2014 5:47 am
by Fred McIntyre

It's almost the end of March 2014, and this bug isn't fixed.

After a couple of days, I have found a method that works for me.

I have found that if the deviceID in the URL does not have the semicolon changed to %3B, it will not work. But if the value for deviceID in the Request Parameters does have the semicolon changed, it does not work. (Figuring that out took most of my time - lots experimenting, and building binaries and installing on my Android)

In the Page Show Event on the first page of my app, I have this Javascript Event:
prevar ID = localStorage.getItem('pushNotificationDeviceID');
localStorage.setItem('deviceID',ID);
ID = encodeURIComponent(ID);
localStorage.setItem('encDeviceID',ID);/pre

to put these values in localStorage.

I created services following the Tutorial at
http://docs.appery.io/tutorials/sendi...

I only needed the Updating the Device, and Receiving device information services, because the device is automatically registered when the app opens (I did nothing to make that happen - Appery takes care of that)

For the services, I added encDeviceID as a request parameter.

In the URL I put /{encDeviceID} at the end instead of {deviceID}

In the mapping, I map escDeviceID and deviceID from the localStorage variables to the corresponding parameters.


Push notification services problem cause by device ID

Posted: Thu Apr 10, 2014 1:04 pm
by Maryna Brodina

Hello!
Thank you for sharing information!


Push notification services problem cause by device ID

Posted: Thu Apr 10, 2014 4:19 pm
by Fred McIntyre

For what it's worth, I've changed how I do this. Perhaps the Appery code has been fixed.

I now have only deviceID as a requrest paramter, not escDeviceID. In the url I use {deviceID} and in the Request mapping, for deviceID I do not map it from any local storage I created. Instead, I just put this in the JS:

pre
return encodeURIComponent(localStorage.getItem('pushNotificationDeviceID'));
/pre

and it is working well.