apla / me.apla.cordova.app-preferences

App preferences plugin for cordova
Apache License 2.0
201 stars 209 forks source link

Ionic 2 #109

Open ThomasKientz opened 8 years ago

ThomasKientz commented 8 years ago

Issue:

I have no success at all using the plugin with Ionic 2.

"plugins.appPreferences" looks not defined.

Do you having any working exemples with Ionic 2 ?

I tried to uninstall it (to reinstall it) but i get the following error :

> $ cordova plugin rm cordova-plugin-app-preferences
> unhandled exception { [Error: ENOENT: no such file or directory, unlink 'platforms/android/res/xml/apppreferences.xml']
>   errno: -2,
>   code: 'ENOENT',
>   syscall: 'unlink',
>   path: 'platforms/android/res/xml/apppreferences.xml' }
> Error: ENOENT: no such file or directory, unlink 'platforms/android/res/xml/apppreferences.xml'

Please specify your environment

Plugin version:

Toolchain:

Platforms affected:

What the scope of your problem:

Environment :

Cordova CLI: 6.3.1 Gulp version: CLI version 3.9.1 Gulp local: Local version 3.9.1 Ionic Framework Version: 2.0.0-beta.11 Ionic CLI Version: 2.0.0-beta.37 Ionic App Lib Version: 2.0.0-beta.20 ios-deploy version: 1.8.6 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v4.4.7 Xcode version: Xcode 8.0 Build version 8A218a

apla commented 8 years ago

Actually, Ionic is based on cordova and if you have followed cordova rules (wait for deviceready, then use anything) everything should be fine.

Seems like I need to add explicit test especially for Ionic.

ThomasKientz commented 8 years ago

Would be very helpful !

ThomasKientz commented 8 years ago

Its working well with 0.99.2 with :

declare var plugins: any; //typescript declaration for Ionic 2

plugins.appPreferences.store(...)

But not with 0.99.3