简体   繁体   中英

Add static file to Resource folder with ionic in XCode project

I need to add some files to the " Resource " folder of the IONIC generated XCode project .

File is InfoPlist.strings , in order to localizate the permission messages, this one:

在此处输入图片说明

I've added files in the ionic project folder:

"Resources/ios/localization/de.lproj/InfoPlist.strings" "Resources/ios/localization/en.lproj/InfoPlist.strings" "Resources/ios/localization/es.lproj/InfoPlist.strings" "Resources/ios/localization/it.lproj/InfoPlist.strings" "Resources/ios/localization/fr.lproj/InfoPlist.strings"

在此处输入图片说明

My question is:

  • What is the way to copy these files when " ionic build ios " is executed, directly in the XCode resource folder?
  • I need to add something particular in the config.xml file? If yes, what?

Extract of config.xml file:

  <platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
    <allow-navigation href="*" />
    <config-file parent="ITSAppUsesNonExemptEncryption" platform="ios" target="*-Info.plist">
      <false/>
    </config-file>
    <icon src="resources/ios/icon/icon.png" width="57" height="57" />
    [...]
    <splash src="resources/ios/splash/Default~iphone.png" width="320" height="480" />
  </platform>

I've solved it by creating a new "empty" plugin.

In the plugin.xml file I've simply added:

<platform name="ios">
    [...]
    <resource-file src="PermissionLocalized.bundle/de.lproj" />
    <resource-file src="PermissionLocalized.bundle/en.lproj" />
    <resource-file src="PermissionLocalized.bundle/es.lproj" />
    <resource-file src="PermissionLocalized.bundle/it.lproj" />
    <resource-file src="PermissionLocalized.bundle/fr.lproj" />
</platform>

and this copy these files on the resource folder of XCode project.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM