简体   繁体   中英

Parse.com API PHP backend and local storage on Android

Since Parse.com was closing, i've recreated parse API endpoints, copied the SDKs on my own repository and changed SDKs base url to point to my server / PHP API.

My API reflects the Parse REST return formats for objects, Users, login, Installation and so on... (expect the Android SDKs actually don't respect whats said in parse API REST endpoints docs - it ALWAYS makes POST requests using a body parameter: {_method: GET|POST|PUT... how surprising and how NOT RESTfull !).

Anyway i've adapted my backend to that flaw and everything works... EXCEPT...

That on the Android SDK (IOS not tested), everything crashed when objects are stored (or retrieved) in the local data storage.

I'm looking for insights on where the problem might come from.

Specs:

  • Backend: PHP REST API returning what the PARSE SDK wants;

  • ObjectId(s) have been made persistent in my backend (i suspected this might come from this);

  • Authorization is achieved via header X-Parse-Application-Id and X-Parse-Client-Key

Does anyone have any insights on how Parse works with object, syncronisation and local storage ? Might the problem be related to updatedAt / createdAt dates ?

Again, everything works fine when local storate is not involved. I'm strongly suspecting the _Installation class to be the falt, but i have no way of debugging this due to my lack of knowledge on Android.

PS: i'm willing to post the API code (developed under Symfony2) on github for everyone if i can fix this issue.

Hurray ! This was not a backend issue but related to this change in the Android SDK:

https://github.com/ParsePlatform/Parse-SDK-Android/issues/398

In short, when you use your own Parse server as described in the parse migration guide , you also need to update your SDK(s)... but... but...

... if you're using local storage on Android your have to use enableLocalDataStore() while "building" the configuration.

I have no idea of how that plays with the IOS SDK but i suspect it would be the same.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM