The preparatory work

There are a few things you need to get your ios app ready

  1. A MacBook with XCode for compiling projects

  2. Register Apple Developer personal account, looking for someone who has Apple Developer corporate account, ask him to add you to the organization, so that you can operate with your own account

  3. An iPhone, mainly for real phone testing

Create the certificate request file

The certificate request file, commonly referred to as CSR, will be used to request a certificate. First, open Application > Utilities > Keystring Access. app, click Keystring Access > Certificate Assistant > Request certificate from Certification Authority in the upper left corner… , as shown in the figure below:

In the following interface, user email address: enter your developer account email address, common name: whatever but easy to find, save it on disk (don’t fill in the CA email address) and put it on the desktop, preferably with your project

Once you have a CSR, you can go to the Apple Development center to generate a certificate

Log in to the Apple Developer Center to generate a certificate

When you log in to the developer Center, you will see the following screen. Click on the box below

To apply for the certificate

This needs to be done twice, because we need a test certificate and a distribution certificate

Click Download to download the certificate

Note: After downloading the certificate to the local must double click import key string inside

Register App Identiifier

You can only create an App in App Store Connect if you have registered your App Id

Click Register, App Id registration is successful

Register the equipment used for real machine testing

The devices used for real machine testing must be registered with the developer center, otherwise the application will not be installed

Click Register to Register successfully

Registering a Profile

This operation also needs to be performed twice as above. The debug and release configuration files are registered with the test certificate and the release certificate respectively. The generated files need to be imported into XCode by double-clicking, otherwise, they cannot be selected during the configuration

Click OK to download the configuration file. Remember to double click to import XCode

Create a new App in App Store Connect

After the creation is successful, fill in the information as much as possible, if it can not be submitted, there is also a build version, which needs to be packaged in XCode and finally sent by XCode

Xcode builds applications

“Projects that have been online before March 2020 can continue to iterate using UIWebView, and will receive a warning email from Apple each time they are submitted for review. For projects after March 2020, WKWebView must be used and submitted for approval, otherwise binary data error will be displayed. For details of apple’s official instructions, click the link below

ITMS-90809: Deprecated API Usage – Apple will stop accepting submissions of new apps that use UIWebView APIs starting from April 2020. See developer.apple.com/documentati… for more information.

Before Cordova -ios6.1.0, we used an official plug-in to convert UIWebview into WKWebview. The usage is as follows

cordova plugin add cordova-plugin-wkwebview-engine

// Add configuration in config.xml
<preference name="WKWebViewOnly" value="true" />
    <feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" /> 
Copy the code

Cordova-ios6.1.0 has removed UIWebview completely, so the plugin above is not needed

cordova platform add ios@6.1. 0
Copy the code

When using WKWebview, we will find that requesting the interface or obtaining the local pictures of mobile phone will occur cross-domain, this is because of the security mechanism of WKWebview. UIWebview originally supports cross-domain, so we can configure cross-domain request through background. We found the CDVWKWebViewEngine. M file in XCode

// Find the method in this file- (WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings { WKWebViewConfiguration* configuration = [[WKWebViewConfiguration alloc] init]; . There is still a part of the code, do not delete...// Add the following two lines above return
    [configuration.preferences setValue:@YES forKey:@"allowFileAccessFromFileURLs"];
    [configuration setValue:@YES forKey:@"_allowUniversalAccessFromFileURLs"];
    returnconfiguration; } Solve cross-domain problems, cookies can not be obtained.Copy the code

Go to platform > ios and here’s the entire Cordova -ios project. Before we get started, let’s do a few things that we can do. Go to Project > images.xcassets. Here we replaced the application chart. I used a software called Asset Catalog Creator. By importing a 1024*1024 image, the App icon required by our project can be generated. We replaced the generated appicon.appiconset folder with the original appicon.appiconset folder and the icon was configured

Double-click the xxxxXXx. xcodePro file to import the project into XCode, and then configure XCode

At this stage, we apply the basic configuration, certificate configuration, information configuration is basically complete

Application packaging and testing

We have two methods of testing, simulator testing and real machine testing

The actual test method is the same, provided that the phone used for testing must be registered with the developer center, otherwise the installation packaging will not be included. Connect the phone to the data cable plug-in, XCode will automatically detect the registered phone, then open the drop-down box to see the name of the real phone, then select and click the triangle

Application submitted

Once the App has been tested, the build can be packaged and submitted to App Store Connect for approval

Open the drop-down box, select the small hammer, and click “Product > Archive” to package the build version. After the package is successful, a picture interface will appear. Next, perform the first step to verify the build version, and if the verification fails, it will not be approved even if the submission is submitted. Generally speaking, it will be stuck for a period of time due to network problems, but it is not a big problem. After a successful upload, you can generally find the build version in App Store Connect after a while, and then fill in the relevant materials to submit for approval

If the upload is successful and the build does not appear, please pay attention to your email. Generally, the problematic build will not appear in App Store Connect

Question list

To list a few problems I encountered:

  • TMS-90809: Deprecated API Usage – New apps that use UIWebView are no longer accepted. Instead, Use WKWebView for improved security and reliability. Learn more (developer.apple.com/documentati…). .

The reason for this, as mentioned above, is that ios has now deprecated UIWebView, so all build submissions should use WKWebview, or even if the upload is successful, the App Store Connect will be rejected due to metadata 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 NSBluetoothAlwaysUsageDescription 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 The version of their code that doesn ‘t contain the APIs. Learn more (developer.apple.com/documentati…). .

The mistakes because I applied to bluetooth (NSBluetoothAlwaysUsageDescription) but not in the info. Plist declared on permissions, so we went back to the info. It is good to put this capability statement on the plist

  • Guideline 2.1 – Information Needed – We’re looking forward to continuing our review, but we need more information about your business model and your users to help you find the best distribution option for your app. Our preliminary review of your app suggests that your app may be a good fit for our Apple Business Manager program, which is designed specifically for business apps.

This question is usually asked by the reviewer who has some questions about the app. He will ask a few questions for you to answer. In this case, you only need to answer his question in both languages carefully, and remember to write in a friendly way

  • The application of the quadrature in the compasses in a generally will not be refused, rejected the general average is the application functions include suggests gambling, violence, pornography and other content, or is the original function of integration used by apple approved third-party libraries, at this time only change plug-in, because we are through the Cordova application the primary function of the plugin integration in, For example: The following error is because I used a plugin that used an unrecognized tripartite library, which was not possible even with the previous version verification