Tools for Apache Cordova (VS2015): Adding custom entries to *info.plist for iOS

后端 未结 2 651
耶瑟儿~
耶瑟儿~ 2021-01-15 09:17

I am using Tools for Apache Cordova on VS2015 to develop a project and I need to set some additional options in the *info.plist file in order to temporarily unblock HTTP we

相关标签:
2条回答
  • 2021-01-15 09:58

    Ok, I have finally worked out how this works. Given the example display name of "My project" above...

    • The plist file should be named "My project-Info.plist"
    • The file should be placed in the folder "res/native/ios/My project"

    I guess that the reference in the documentation to "config.xml display name" does actually make sense in as much as it refers to the "Display Name" from the common tab when viewing "config.xml" in the designer (though the element is actually named "name"). I still do not think this is very clear though!

    Note however that the file will be used instead of the generated file, and that any changes made to the config.xml will NOT be reflected in this file (you will instead have to replicate these changes manually).

    It is therefore suggested that you start with a copy of the original file which can be found at "platforms/ios/{display name}/{display name}-Info.plist", or sticking with the example, "platforms/ios/My project/My project-Info.plist".

    0 讨论(0)
  • 2021-01-15 10:10

    You can create a plugin to do this. This is what the plugin.xml will look like:

    <plugin ...> <platform name="ios"> <config-file target="*-Info.plist" parent="UIStatusBarHidden"> <true/> </config-file> <config-file target="*-Info.plist" parent="UIViewControllerBasedStatusBarAppearance"> <false/> </config-file> </platform> </plugin>

    This is a good reference: https://github.com/leecrossley/cordova-plugin-transport-security

    0 讨论(0)
提交回复
热议问题