Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Push notification services problem cause by device ID

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

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Push notification services problem cause by device ID

Hi,

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

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Push notification services problem cause by device ID

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.

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Push notification services problem cause by device ID

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

Bad Addy
Posts: 0
Joined: Fri Dec 13, 2013 9:34 pm

Push notification services problem cause by device ID

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.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Push notification services problem cause by device ID

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

Oleg Danchenkov
Posts: 0
Joined: Tue Apr 30, 2013 5:51 pm

Push notification services problem cause by device ID

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)

Fred McIntyre
Posts: 0
Joined: Sun Jan 12, 2014 5:04 pm

Push notification services problem cause by device ID

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.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Push notification services problem cause by device ID

Hello!
Thank you for sharing information!

Fred McIntyre
Posts: 0
Joined: Sun Jan 12, 2014 5:04 pm

Push notification services problem cause by device ID

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.

Return to “Issues”