Parser not working after build


#1

Hi all!
I am using parse.com and all working correctly if I run it from browser, but when I am building it looks like my apk don’t have an access to internet, I can see that I have a permission but still its not working,


#2

I have the same problem.


#3

No error logs? No plugins? No information on how you’re using the parse api?

You can’t expect ANYONE to help you with out any information. Please give a lot more information so we can try and help.


#4

That’s how I used the parse api in the ionic app:

1.Downloaded parse.js
2. Included it in index.html
3. In app.js
Parse.initialize(appId, jsID);

There are no error logs for ionic, but the android emulator throws the following ones:

5968-5968/com.ionicframework.blabla D/SystemWebChromeClient﹕ file:///android_asset/www/lib/ionic/js/ionic.bundle.js: Line 20306 : You need to call Parse.initialize before using Parse.
5968-5968/com.ionicframework.blabla I/chromium﹕ [INFO:CONSOLE(20306)] “You need to call Parse.initialize before using Parse.”, source: file:///android_asset/www/lib/ionic/js/ionic.bundle.js


#5

So that error tells you exactly what’s going wrong, make sure you have the white list plugin installed, make sure that you are in fact calling parse init before anything else. By the way, I do not recommend using the javascript API in a cordova app as angular doesn’t play well with it, but rather the REST api tools and Cloud Code. It’s a little more set up, but a lot more secure because no one can modify your cloud code, and a lot more compatible.

Good luck


#6

I know I am calling parse before anything else, because it works the right way in the browser. Maybe I need to install that whitelist plugin.

Thanks for the advice on using the REST API. I will take a look into it.


#7

No problem, I just struggled with a bunch of null errors, queries not being called, etc when I tried to use it. I think it’s definitely more meant for jQuery and a website than Angular and a complex app. The cloud code is really neat though because you can do SO much more to secure your users data.


#8

When you tried to add parse with js, did you have to use the whitelist plugin? If yes, how did you do it, since there is no url explicitly written by me?

I just want to understand what is really causing this problem, so that I can afterwards improve the software.


#9

The white list plugin is relatively new, it’s not included by default in the current Ionic NPM. There are a lot of tutorials online for it since every app is a little different I’d recommend using those. It’s a cordova plugin so it’s not JUST for ionic.

If parse or * isn’t whitelisted then parse init will fail, and if you don’t handle it in your app any queries and calls are going to be going to undefined or an empty parse object. Ideally, you would want to error handle that, so if parse fails to init then any parse call gets routed to a local storage system or the user is notified that there is no network connection, something like that.

Android is especially difficult because of the platform fragmentation. I have weird bugs on my android app that i just don’t even take the time to fix because it’s not worth the time, iOS is always a priority in my book. Just a little more insight into that… haha lots that goes on in my brain about this stuff


#10

Everything is working as expected now! Thanks!