Wednesday, 4 September 2013

phonegap plugin config for ios

phonegap plugin config for ios

I need to develop a plugin for Phonegap, not use an existing one!
I need to add custom settings for platfoms. In Android is done in
plugin.xml A code part for Android is:
<!-- android -->
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
...
</config-file>
<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</config-file>
...
</platform>
Similar way I would like to add custom settings for iOS. Need to be
modifyed the .plist ( not AndroidManifest.xml ) Need to be added this
lines of code:
<key>UIBackgroundModes</key>
<array>
<string>location</string>
</array>
How to do it?
I have:
<!-- ios -->
<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="MyPluginName">
<param name="ios-package" value="MyPluginName"/>
</feature>
</config-file>
<header-file src="src/ios/MyPluginName.h" />
<source-file src="src/ios/MyPluginName.m" />
</platform>

No comments:

Post a Comment