简体   繁体   中英

phonegap get values from settings.bundle ios

I am new to phonegap ,I have field called name_preference in settings.bundle, i am trying my code in main.js

 function deviceReady()  {
 window.plugins.applicationPreferences.get('name_preference',
 function(result)  {
         alert("We got a setting: " + result);
     },  function(error) {
         alert("Failed to retrieve a setting: " + error);
     } );

I had downloaded applicationPreferences.h ,applicationPreferences.m and placed in xcode then applicationPreferences.js and placed in js folder. help me out, how can i get value from settings.bundle from phonegap ios

I had downloaded applicationPreferences.h ,applicationPreferences.m ...

Managing a plugin by hand is nearly impossible. Remove those files, and from the command line, run

phonegap local plugin add https://github.com/apla/me.apla.cordova.app-preferences.git

This will download the plugin, place it in the correct places, etc etc. No hassle for you!

Alternative answer:

Placing the .m and .h files in Xcode is not enough. You will also need to right-click the Project Navigator pane in Xcode and click "Add Files...". Then, select the .m and .h files. Xcode will now include them in the build.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM