Skip to content

tkikuchi2000/cordova-plugin-add-usage-description

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cordova-plugin-add-usage-description

Add usage description to Info.plist

How to Use

Install the plugin by fetching the dependencies

$ cordova plugin add https://github.com/tkikuchi2000/cordova-plugin-add-usage-description.git#1.1.3

Modify your project root to have the following structure:

Cordova Project Root
  |
  |__ usage-description
       |
       |__  usage-description.json

A JSON file may look like this.

{
  "descriptions" : [
    "NSCameraUsageDescription",
    "NSLocationWhenInUseUsageDescription",
    "NSLocationAlwaysUsageDescription"
  ]
}

Install iOS or Android platform

cordova platform add ios
cordova platform add android

Run the code

cordova prepare ios 

Info.plist is modified like this:

    ...
    <key>NSCameraUseUsageDescription</key>
    <string>usage description is here</string>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string>usage description is here</string>
    <key>NSLocationAlwaysUsageDescription</key>
    <string>usage description is here</string>
    ...

Describe usage in InfoPlist.strings ( use plugin: cordova-plugin-localization-string ).

About

Add usage description to Info.plist

Resources

License

Stars

Watchers

Forks

Packages

No packages published