apla / me.apla.cordova.app-preferences

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

Are there any examples? #64

Open halindrome opened 8 years ago

halindrome commented 8 years ago

The documentation is a little thin. I don't really even know where to get started. Are there any examples?

stefhenry commented 8 years ago

You can check the README.md file, very clear :)

halindrome commented 8 years ago

Hmm - I did look at README.md. It has good documentation on the API, but I really don't quite understand how to get from "here is a list of things I want in a preference panel set" to "my application shows its preferences panels when the user clicks here". That's what I meant by an example.

apla commented 8 years ago

This plugin contains 2 parts:

  1. Javascript interface to access preferences;
  2. Native preferences interface generator.

Seems like you need to use preference generator. And preference generator docs is thin. Here is some notes on how to achieve what do you want:

  1. Install latest version of plugin. After plugin is installed, you can inspect app-settings.json in app folder (or here).
  2. There is supported fields list: https://github.com/apla/me.apla.cordova.app-preferences#preferences-interface-generator
  3. Please run cordova prepare after app-settings.json modification
  4. In your app call appPreferences.show() to display preferences. Please note, on android preferences don't reflect default values (#62).
sylfree9999 commented 8 years ago

Hi,I'm quite new to this too.For what I know, MDM can set some app configuration values for application. For example, I need email address to be retrieved from MDM. (http://www.appconfigforenterprise.org/dev-center/)How can I get the value by this plugin? I'm quite lost about all this. Like: What does the app-settings.json do? Does it populate plist/xml file for application? Would that be enough if I just add the EmailAddress key in the app-settings.json?

BTW, how can I test the scenario like above?

Your help would be really appreciated! This would be much helpful if you could provide the newbies with some sample application(ionic or other frameworks) !!

Thanks anyway.