Ionic and Javascript SDK failing to initialise


Hi all.

I am having some trouble integrating the Javascript SDK into my project. I have looked all over for a solution but can’t find one.

I followed the instructions located in the following link:

As suggested I have included the latest parse.js file in my index.html, I have put the following code into app.js under the $ionicPlatform.ready() method (using my appID and JSID taken from Parse): Parse.initialize("APP_ID_HERE", "JAVASCRIPT_ID_HERE");

I am also using the Parse Angular Patch and have followed all instructions for this. i.e. including the patch.js file in index.html and adding the code to app.js like so: angular.module('myApp', ['ngAnimate', 'parse-angular'])

I have excluded the Parse Angular Patch also to make sure it is not this causing the issue, the issue remains in the absence of the patch.

In my controller I have the following code

var query = new Parse.Query("testUser");
    query.equalTo("facebookID", "10101185732529923");

Initially this worked and logged the data from Parse but then stopped. Every 10-20 attempts it seems to work once but otherwise gives the following error in the console:

You must specify your applicationId using Parse.initialize. <ion-nav-view name="tab-nudges" class="view-container tab-content" nav-view="active" nav-view-transition="ios"> ionic.bundle.js:20306

I don’t understand this as it is clearly specified in app.js and works sometimes. Any help would be very much appreciated.




i know alot of people are recommending using the parse-angular-patch, but I have a simple straight forward implementation just using the REST APIs that might help you get started.



I am getting same error sporadically while running my app on browser or iphone. I dont want to use any other api to fix it.

Did you get some better solution ?


Hey @antonfire,

I think I found the solution.

All you need to do is just move your code out from $ionicPlatform.ready.

angular.module().run(function($ionicPlatform) {
Parse.initialize(“APP_ID_HERE”, “JAVASCRIPT_ID_HERE”); // this is the new place
$ionicPlatform.ready(function() {});


Thanks @jainank that worked like a charm :smile: