0

We have a Cordova 5 project that is targeting both Android and iOS. Out of the box, Cordova's config.xml supports a number of options that appear to get written to the platform-specific files:

  • /platforms/android/AndroidManifest.xml
  • /platforms/ios/MyApp/MyApp-Info.plist

There are a number of new config options we are adding that do not appear to be handled by Cordova/config.xml - targeting specific SDKs/devices, configuring icons, splashscreens, hardware acceleration, and adding in app-linking, among others.

We can manually edit the platform-specific file, but as this is in /platforms, those changes are not tracked (I've read that storing /platforms in source control is not advised, and I agree). I see that some handle this using custom hooks - these work, but add yet another layer of complexity, and more code to maintain. Am I missing a third-way to manage platform config via a node package or something that can parse a config and generate the appropriate platform settings (I can't find anything)?

FYI, we use gulp to build our source prior to feeding it to Cordova.

Community
  • 1
  • 1
Unpossible
  • 10,607
  • 22
  • 75
  • 113

1 Answers1

1

I don't think there's currently a "magic bullet" solution for handling platform-specific app settings that Cordova doesn't yet handle.

The approach I'm using is a (mostly) generic hook script to set these preferences, based on this hook by @djett.

For the iOS plist, you can set pretty much any property using the existing implementation. For Android, I have extended the preferenceMappingData object with a few additional properties. Perhaps through some community collaboration we could make the coverage of this mapping more or less complete, then this can become a viable generic solution until such time as Cordova supports these settings out-of-the-box.

Hope this helps :-)

DaveAlden
  • 30,083
  • 11
  • 93
  • 155