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:
Hi,
Do you run it on device or in desktop browser? What is your device OS version? Device ready won't work on browser.
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.
On the screen SignUpScreen please delete second action (Invoke service) on Device ready event.
Did you try it on real device?
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:
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.
Hi Bad, it could be the problem with the emulator, we'll test it on a device and we'll update you.
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)
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.
Hello!
Thank you for sharing information!
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.