Ionic / Apple: The things to do before to publish on store
03, December 2019If you develop with Ionic or Phone Gap framework using Cordova, there are tasks to do in Xcode before to publish on store.
Cordova stack generate a Xcode project used to manage the App on store.
However, some confugrations do not work very well or do not exist.
I give you some tips according to my feedback.
1. The default language
When project is generated by Cordova, the default language is en-US
. If your App is not from United States, it would be wise to change that.
1.1. Modification in XCode
In Xcode, open the tab Project Navigator.
Open the file {Your App} > Resources > {Your App}-Info.plist
Update the property Localization native development.
1.2. Modification in the Cordova project
In the file config.xml, add the following lines in the tag <platform name="ios">
:
<edit-config file="*-Info.plist" mode="merge" target="CFBundleDevelopmentRegion">
<string>fr_FR</string>
</edit-config>
Be careful, during the build, this line only affects the file platforms/ios/Pods/Target Support Files/Pods-{Votre App}/Pods-{Votre App}-Info.plist
.
You shall manually merge the following configuration in the file platforms/ios/{Votre App}/{Votre App}-Info.plist
:
<key>CFBundleDevelopmentRegion</key>
<string>fr_FR</string>
2. The geolocation
If you want to use the GPS, Apple require that some parameters are defined in the file Info.plist
.
2.1. Modification in XCode
In Xcode, open the tab Project Navigator.
Open the file {Your App} > Resources > {Your App}-Info.plist.
Add a description to the following properties:
- Privacy - Location Always Usage Description
- Privacy - Location When In Use Usage Description
Use for instance the following description: To locate me
2.2. Modification in the Cordova project
In the file config.xml, add the following lines in the tag <platform name="ios">
:
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
<string>To locate me</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysUsageDescription">
<string>To locate me</string>
</edit-config>
As the previous key, the configuration shall be manually merged:
<key>NSLocationWhenInUseUsageDescription</key>
<string>To locate me</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>To locate me</string>
Note that without this configuration, you will obtain this kind of error:
ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSLocationAlwaysUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).
3. Build number and target
By default, Cordova use the App version number for the build number. To deploy your app on the store, you will probably need several tests, without changing the version. The build number shall be manually updated.
In XCode, click on Your App, then the tab General.
Change the build number to 0, 1, 2 ...
You shall do this operation on each build from Cordova.
You shall configure the application target too, defined on iPhone and iPad by default. If you want only one, change the target in the section Deployment Info.
I hope that it is useful for you and I see you in the next article.
Add a comment