How to Upload in-app Purchase Application Loader
Uploading iOS In-app Buy Downloadable Content
In-app purchases permit a developer to add content to their apps that can exist purchased to enable boosted features. Developers also take the selection of downloading additional content to a device in one case a purchase is fabricated. This content tin exist hosted all the same the developer would like, but the almost cost effective is to let Apple to host your in-app purchase content.
Unfortunately, Apple has non fabricated this a seamless feel. The process has inverse over the years and at times has been piece of cake, but my nearly recent feel was very frustrating.
Awarding Loader
Up until a twelvemonth ago, a developer could utilise Awarding Loader to upload in-app buy content. This tool is available as part of XCode under the XCode application menu->Open up Programmer Tools.
This tool made it very easy to upload content and the removal of this feature most a year agone is unfortunate. This tool appeared to be an interface on summit of the iTMSTransporter tool that I volition detail beneath.
XCode Organizer
The XCode Organizer does appear to support the uploading of In-App Purchase content, nonetheless this has been striking-and-miss for me but information technology is worth trying for your application as information technology should be much easier than using the control-line.
When I try to use this option I get the mistake shown in Epitome 3 below. XCode is unable to find the application record that corresponds to the upload.
iTMSTransporter Command-line Tool
This is the option I am currently using to successfully upload my In-App Purchase content.
To offset, follow the instructions to setup iTMSTransporter on your development machine
If required, create an app-specific countersign for using with iTMSTransporter as it will need to access your iTunes Connect portal.
Use the post-obit command to exam your connection:
iTMSTransporter -thousand diagnostic -t Aspera There are lots of different command-line options for iTMSTransporter depending on what you're trying to practise. I will only particular the minimum number of commands/options to accomplish my goal of uploading In-App Content for my awarding.
Download App Metadata
To outset, nosotros need to download the app metadata for the application that we need to upload content for. To achieve this nosotros need to find the Vendor ID for the specific application we are uploading content for.
The Vendor ID tin be institute by logging in to iTunesConnect, get to your apps and select the application for which you want to upload content for. Under App Information await for the SKU value — this is your Vendor ID.
The following command will download an iTunes Store Package for your awarding to the electric current directory:
iTMSTransporter -m lookupMetadata -u <itunes connect userID> -p <app specific password> -vendor_id <Vendor ID> -destination . In that location will now exist a directory chosen <Vendor ID> inside your current directory containing your app metadata.
Gear up In-App Content
You will need to export your In-App Content as an Installer Package. This tin be accomplished past Archiving your In-App content inside XCode and selecting the Installer Parcel method of distribution and saving your content locally
At this betoken, you should have an iTunes Store Parcel with a name of your app SKU number that contains your Installer Package files. For example, if your SKU was Case:
Using Finder, move the files within your Installer Package directory into this Vendor ID folder. You can select Testify Package Contents to browse to this directory.
Later copying the files to the iTunes Shop Package yous should see the following list of files where inapptest.pkg is the name of your In-App Purchase identifier in iTunes Connect:
Almost Done — metadata.xml Changes!
The last stride in preparing our content is to update the metadata.xml file. Use your favorite editor to open this file. To beginning, we need to remove a bunch of content — this should non be the example, simply if nosotros exercise not do this step our file will fail verification as of the time of writing this blog:
Remove everything betwixt <versions> and </versions> (including the XML tags) and everything between <products> and </products> (again, including the XML tags). To clarify, the <version> tag, all the content and the endmost </versions> tag need to be deleted. The same for the <products> tag and content.
Now, search in the file for your In-App Purchase Product ID. You lot should discover a section in the document enclosed within <in_app_purchase> tags.
Assuming you lot take setup your purchase properly, you should meet an embedded XML section for this In-App Purchase:
<has_hosted_content>true</has_hosted_content> If y'all do not have this, you should become Turn On Hosted Content for your In-App Purchase inside iTunes Connect. Once you enable this, you would demand to perform the iTMSTransporter lookupMetadata control once more to download a new metadata.xml file.
Immediately subsequently the <has_hosted_content> tag add the following if information technology does not already be:
<software_assets>
<nugget type="in-app-purchase-content">
<data_file>
<size>323170674</size>
<file_name>inapptest.pkg</file_name>
<checksum type="md5">e04ba40c68effe5fc3fcce666761b2d0</checksum>
</data_file>
</asset>
</software_assets> We need to modify the <size>, <file_name> and <md5> values to match your content. The <file_name> should friction match the filename for your .pkg file — in my example that is inapptest.pkg. You lot can get the <size> and <md5> values by running the following commands and replace the values in the file with the results:
stat -f '%z' <pkg filename> -- Size value
md5 <pkg filename> -- md5 value Terminal Step!
From the parent directory that contains your iTunes Store Package we volition verify the packet using the following control, replacing Case.itmsp with your .itmsp packet name:
iTMSTransporter -m verify -u <itunes connect userID> -p <app specific password> -f Example.itmsp/ Assuming the bundle verifies properly, you lot then upload your content again replacing Example.itmsp with your .itmsp package name:
iTMSTransporter -m upload -u <itunes connect userID> -p <app specific password> -f Example.itmsp/ At this point, assuming you receive a success message, you accept to look for the content to testify upward in iTunes connect. You tin query the servers using the following command, however I find the status to be very delayed
iTMSTransporter -thousand statusAll -u <itunes connect userID> -p <app specific password> -vendor_id <Vendor ID> -outputFormat xml Patience
It typically takes a few hours for content to bear witness upwards and it can be frustrating considering the condition command does not typically show that they received the content.
Good luck and I hope this helps yous upload your content for an In-App Purchase!
Here is the app that I was uploading content for — iBird Lite
Cheque out our newest awarding supporting photo recognition — iBird Photo Sleuth
Source: https://medium.com/@tonyspin/uploading-ios-in-app-purchase-downloadable-content-727e0d2c0531
0 Response to "How to Upload in-app Purchase Application Loader"
Post a Comment