Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

Error saving data with pointer from a mobile App but works in Appery / browser mode

Hi

Recently I introduced pointers into my DB and started encountering a strange problem.

I'm able to save records with pointers while I work on Appery and even using the Appery tester App.

However when I create an APK and run on Android it gives me an error.

This is my code to store a pointer value

var id = localStorage.getItem("udid");
return {"collName" : "userdetails", "_id" : id};

Not sure why this is happening.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Error saving data with pointer from a mobile App but works in Appery / browser mode

Hello Shawn,

Please clarify, do you mean that the same code works in the browser, but does not work on the device? You should do alert(id) before return to be sure that the id is read correctly from local storage (and correctly was recorded there earlier).
Also please tell us what device do you use with what OS?

Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

Error saving data with pointer from a mobile App but works in Appery / browser mode

Yes the code is the same. Works on the Web and fails when
running as an Android APK.

The Android App is running on a test phone which is a
Huwaei Y300 running Android 4.1.1. I've also got a BlueStacks
test environment on which it fails.

I will be debugging all values using Alert() to see and let you know.

One thing I noticed that I'm not always passing
X-Appery-Session-Token from stored local storage variable
could this be an issue ?

Shawn
Posts: 0
Joined: Sat Jun 21, 2014 11:13 pm

Error saving data with pointer from a mobile App but works in Appery / browser mode

ok sorry ... figured this out. it was the userid local storage variable wrongly set in my dev env as compared to the phone. thx for the direction.

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

Error saving data with pointer from a mobile App but works in Appery / browser mode

Hi Shawn,

Thank you for the update. Glad you figured this out!

Return to “Issues”