No Plugin loaded on ios

Hi,

I had my app working with android, and now I’m trying to build my app for ios.

So I checkout my app,
npm install,
bower install,
ionic platform add ios,
ionic serve to verify (everything seems fine while plugins can’t be verified now),
ionic build ios
open blabla.xcodeproject
click on “play” button to run app on an iPhone 6.

AND:

The app runs but splashscreen never disappear, because the hide function is never reached, because navigator.splashscreen is undefined.
By using AutoHideSplashScreen in config.xml, I can hide splashscreen, and then I discover none of my plugins are loaded, like camera, globalization, image cache, and splashscreen.
Everything seems fine otherwise.

Please help me!!

You have to use plugins in $ionicPlatform.ready()

I already use this:

$ionicPlatform.ready(function() {
  if (navigator.globalization) {
    navigator.globalization.getPreferredLanguage(
      function (language) {
        var l = language.value.split('-')[0];
        $translate.use(l);
        tmhDynamicLocale.set(l);
      },
      function () {
        print('Error getting language\n');
      }
    );
  }
  else {
    var l = 'en';
    $translate.use(l);
    tmhDynamicLocale.set(l);
  }
  if (navigator.splashscreen) {
    $cordovaSplashscreen.hide();
  }
});

But, it stays in english while my phone is set to french, and splashscreen doesn’t disappear.
I set an alert in this function to see if it is triggered, and it is. So it means navigator.splashscreen and navigator.globalization are undefined.

Hmm, I did the exact same thing and it works for me… did you include ionic in your app.js ?
And is your code in app.js ?

this:

angular.module(‘myApp’, [‘ionic’, ‘ngResource’, ‘ngOpenFB’, ‘jrCrop’, ‘pascalprecht.translate’, ‘ionic-cache-src’, ‘tmh.dynamicLocale’])

is what you mean by include ioni in app.js
Yes everything I quote is in app.js

Yeah!! I finally got it!! Thx for your help.

The solution was:
I previoulsy installed the plugin "ionic-platform-web-client"
This bootstrap cordova in index.html.
When I checked out on a new computer, I forgot to install this again.
And So cordova didn’t run, and so the plugins.

You actually made me look at my index.html, so you finally helped me :slight_smile: Thx!

Glad you solved it.
If you have any problem, feel free to ask me in French in PM :wink:

1 Like