EddyVerbruggen / cordova-plugin-app-icon-changer

Change the homescreen icon of your Cordova iOS app at runtime!
MIT License
32 stars 20 forks source link

How to check if AppIconChanger is available #2

Closed inexuscore closed 7 years ago

inexuscore commented 7 years ago

Hi I'm using this plugin on a Ionic 1.3.2 project with Cordova 6.x. I've installed the plugin but when I call the isSupported() method nothing happens.
I don't get any JavaScript error either so, how I check if the object is available?
P.S I'm testing the app on a Android 6 device, so I just need to see if its available or not.

This is my service method, pretty straight-forward.

 isSupported(): ng.IPromise<boolean> {
            console.log('AlternateIconService.isSupported() reached');

            let d = this.$q.defer();

            this.$ionicPlatform.ready(() => {
                console.log('ionic platform ready. check app-icon-changer');

                console.log('AppIconChanger', AppIconChanger);

                AppIconChanger.isSupported((supported) => {
                    console.log("AppIconChanger.isSupported()", supported);
                    d.resolve(supported);
                });
            });

            return d.promise;
        }
EddyVerbruggen commented 7 years ago

This plugin is for iOS only so you can check that.

inexuscore commented 7 years ago

yup I had to handle the error callback. it returns class not found.
cheers