apla / me.apla.cordova.app-preferences

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

nothing is getting recognised in ios #117

Closed dwissmann closed 7 years ago

dwissmann commented 7 years ago

Issue: I am very sorry to write this (it is my first app using cordova) but I cannot - for the live of me - figure out how to use this plug in. I installed the plugin via cordova. Then I updated the cordova-plugin.js file with the following entries: { "id": "cordova-plugin-app-preferences.AppPreferences", "file": "plugins/cordova-plugin-app-preferences/www/apppreferences.js", "pluginId": "cordova-plugin-app-preferences" }, { "id": "cordova-plugin-app-preferences.AppPreferenceTask", "file": "plugins/cordova-plugin-app-preferences/www/task/AppPreferences.js", "pluginId": "cordova-plugin-app-preferences" } I hope that was correct! Then I added the following snipped into my index.html file: prefs = cordova.plugins.appPreferences;

Then, I added a test function that is called via a button: `function testMobileApp() { $("#windowTitle").append('

testing the mobile app

');

prefs.fetch (function(rt){
    $('#messageClient').empty();
    $('#messageClient').append("your server preference is " + rt);
    $('#messageClient').trigger('create');
}, fail, 'server');

}`

and I get the error:

TypeError: prefs.fetch is not a function. (In 'prefs.fetch', 'prefs.fetch' is undefined)

am I doing everthing totally false? Would you please help me

Please specify your environment

Plugin version:

Toolchain:

Platforms affected:

What the scope of your problem:

dgadelha commented 7 years ago

Have you included cordova.js in your web page?

dwissmann commented 7 years ago

That was it - the new version generates a new Cordova.js file and distributes it - I was linking to my own file instead of the one generated in the root of the project. Thanks - took a lot of digging

Dom Wissmann

On Jan 14, 2017, at 12:34 PM, Douglas Gadêlha notifications@github.com wrote:

Have you included cordova.js in your web page?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.