admin管理员组文章数量:1415111
Im trying to figure out a way to automate the creation of In App Purchases in a mobile app in app store connect, as I have a batch of 200+. Was trying to use fastlane and spaceship but the Tunes:: method was deprecated and couldnt find any other way to address this ops. In the updated list of fastlane the isnt any function calling In App Purchases. In my web search I found similiar problems. ChatGPT told my to try: Spaceship::ConnectAPI::InAppPurchase.create but this option isnt exist. This is the code I tried: (chatGPT code)
require "spaceship"
# 1. Login to App Store Connect with your Apple ID
Spaceship::ConnectAPI.login(
"YOUR_APPLE_ID",
"YOUR_APP_SPECIFIC_PASSWORD" # if 2FA is enabled
)
# 2. Find your app using the newer ConnectAPI
app = Spaceship::ConnectAPI::App.find("company.yourapp")
unless app
puts "App not found. Check your bundle ID or account/team."
exit
end
# 3. Create a consumable in-app purchase with a review screenshot
Spaceship::ConnectAPI::InAppPurchase.create(
app_id: app.id,
reference_name: "My New Consumable",
product_id: "company.yourapp.item1",
in_app_purchase_type: Spaceship::ConnectAPI::InAppPurchaseType::CONSUMABLE,
family_sharable: false, # Consumables typically aren't sharable
review_note: "Optional notes for Apple's reviewer, if desired",
# Provide a valid path to your screenshot here (Windows example):
# Use forward slashes or double backslashes
review_screenshot: "C:/path/to/your_screenshot.png",
# 4. Localizations (must have at least one locale)
in_app_purchase_localizations: [
{
locale: "en-US",
name: "New Consumable",
description: "Description of what this consumable does"
}
# You could add more localizations if needed, e.g. 'fr-FR', 'de-DE', etc.
],
# 5. Pricing (optional, but many want at least a base price)
prices: [
{
territory: "US", # ISO country code for the U.S.
value: 0.99 # Price in USD
}
]
)
puts "In-app purchase created successfully!"
Does anyone faced similar problem? what was your solution?
Use the Tunes:: Method but it got deprecated and doesnt work. Find a soulution online, some say you can use Rest API but im trying to face it with fastlane and spaceship.
Expecting a solution based on Fastlane and Spaceship
本文标签: iosAutomating InAppPurchase creation in App Store ConnectStack Overflow
版权声明:本文标题:ios - Automating InAppPurchase creation in App Store Connect - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745211380a2647906.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论