Can't find variable: NativeStorage


#1

Hello everyone!

I’m dealing with the next error using cordova-plugin-nativestorage.

Error: Can’t find variable: NativeStorage

When i start my app (the first launch with splashscreen), a service that use that plugin to get data is fired, because i have a $ionicView.enter calling this service.
But seems that plugin is not loaded.
After the first loading everything work well.
Only happen on ios. Debugging I saw that iOS and Android loads js files in different order.
Anyone can give me some hints on that?

Thanks :slight_smile:


#2

did you wrap your call of the native storage plugin in $ionicPlatform.ready?

because you have to be sure, that cordova and the pluginsystem are ready.
http://ionicframework.com/docs/api/utility/ionic.Platform/
http://ionicframework.com/docs/api/service/$ionicPlatform/


#3

Oh!!

Thanks, i fix the problem wrapping the call as you said.

:heart_eyes: