问题
I'm working iOS client for a site where users can create and sell courses. Since Apple wants all the purchasable products in iOS app to be available as in-app purchases, I need a way to automate that in-app purchases generation. For now I've read 'App Metadata Specification' and 'Transporter User Guide' docs and that seems like a way to do it: generate metadata package when any course edited (created or deleted) and automatically (some script?) feed it to transporter. But I'm lacking playground and experience here - app is not in AppStore yet. So I can't play with in-app purchases for it. So I wonder about that created via transporter in-app purchases: will they be immediately available for sale? What if I need to change for example name of in-app purchase (because course on server got it's name edited). Should I just upload package with the whole bunch of in-app purchases?
PS good example of my app I want to be like is Udemy: lots of courses available as in-app purchases, each course represented by it's own non-consumable product (since product title while purchasing matches course name)
回答1:
Yes, there is. It's Spaceship - a ruby gem part of fastlane that uses web scrapping to interact with Apple's web services.
I added 45 IAPs to ITC in under 10 minutes with screenshots and all by:
- Creating a .csv file with the data for my IAPs
- Making a ruby script using fastlane that uploads the IAPs
Instructions on how to do the same I did: https://goodkindoflazy.com/2017/12/11/automating-iap-creation-in-itunes-connect/
The gist of it is this, which I found in this blogpost:
app.in_app_purchases.create!(
type: Spaceship::Tunes::IAPType::NONCONSUMABLE,
versions: {
"en-US" => {
name: "Display name",
description: "Description has at least 10 characters"
}
},
reference_name: "IAP reference name",
product_id: "com.your.app.consumable",
cleared_for_sale: true,
review_notes: "A note for a reviewer",
review_screenshot: "/Users/you/Desktop/iap.jpg",
pricing_intervals:
[
{
country: "WW",
begin_date: nil,
end_date: nil,
tier: 1
}
]
)
回答2:
We finally found a way to do it. The idea is to use Transporter provided by apple: https://itunesconnect.apple.com/transporter/1.7.6/iTMSTransporter_1.7.6.pkg.gz
It is actually a java app that can be used to update app metadata. As far as we noticed, in-app-purchases are part of app metadata. This transporter gets special xml as input. The official documentation should be accessible here: http://www.apple.com/itunes/go/itunesconnect/manageApps, under the links “Transporter User Guide” and “Metadata Specification”.
来源:https://stackoverflow.com/questions/25410090/is-there-a-way-to-fully-automate-ios-in-app-purchase-creation-editing-deletion-i