I’m using Parse Server as a back end (the open source version). I have native Android application that saves an object to the server’s DB. The object is really simple one, just a key-value pair. When Android application creates an object, it creates it as JSON object.
Now I want to retrieve the same object from an Ionic 2 app. In Ionic app I use JS Parse API to access back end. When an object is created in JS API it’s created as plain text object.
As a result I’m getting: 101 Object not found
It seems like what I need to do is to translate Parse plan text object in my Ionic app to Parse JSON object.
This is what I tried to do:
According to the JS Parse documentation one of the methods of Parse.Object is toJSON(). I tried to apply this method in different combinations to the Parse object before creating query, but I always get an error: this.parse.Object.extend(…).toJSON is not a function
I tried to apply standard JSON Api (i.e. JSON.stringify) to the Parse object. In this case I’m getting an error: ParseQuery must be constructed with a ParseObject or class name.
I did very extensive search on internet and found nothing helpful.
Bumping this thread - Parse open source continues to be a reliable backend for many Ionic apps to date. There is absolutely a foreseeable future for Parse in Ionic 2. I’m continually searching for a portable solution and will post here if I find something reliable.
But it’s not for the latest version of Parse Server. As I mentioned earlier in this thread, I didn’t manage to make it work with the latest version so far.
Ok. So far the only way I can get it to work is adding <script src="//www.parsecdn.com/js/parse-1.6.14.min.js"></script> to index.html and in my components use declare var Parse: any;
Doing so I get no compiling errors but in console I get this error Uncaught TypeError: Super expression must either be null or a function, not undefinedexports.default @ inherits.js:21(anonymous function) @ LiveQuerySubscription.js:129(anonymous function) @ LiveQuerySubscription.js:160createCommonjsModule @ component_factory_resolver.js:61(anonymous function) @ map.js:1(anonymous function) @ index.js:1
I got parse working in both ionic serve and device. But only in app-script version v.0.0.30. Later ionic app-scripts versions, like 31 ~ 36, the script workaround doesn’t work.