If the APP has in-app purchase, you need to add in-app purchase products in the background. If you have to add it often, it can be a hassle. This is done in script.
Pay attention to the point
- No in-app purchase items with the same name are allowed. Deleted in-app purchase ids cannot be used again.
- The script itself depends on
spaceship
And thespaceship
Belong tofastlane
The underlying driver logic. For details, go to the source code - This script belongs to
ruby
Script, so it could beruby
Code execution. - This script only creates CONSUMABLE products. Other types can be implemented as a reference
The script content
The following points should be noted:
- The user name and password need to be entered on the command line, this is based on
fastlane
The core implementation of screenshot
Note screenshot, the same picture used here, please note- At creation time
versions
Fill in the internationalization information in the field, only in Chinese here review_notes
Audit remarkspricing_intervals
It’s price information, so it’s just a fixed price, adjusted as needediap_id
Indicates the fixed prefix of the purchased product ID- The name must be longer than 10, or it will fail. Please note that
The require "spaceship" # # # parameters the user name and password username = "fill in the APPLE account here" password = "password" fill in the APPLE here # # APPID APPID = "here to fill in the application ID # # Spaceship:: looney. Login (username, Spaceship:: looney. Login (username, Spaceship:: looney. Password) # for specified APP APP = Spaceship: : the itunes: : Application. The find (appid) to create new projects within # # # ID purchase commodities in the format, Iap_id = "#{appID}.offical." ## Consumable project ## 6 yuan =36 diamonds ## 18 yuan =120 diamonds ## 30 yuan =206 diamonds ## 98 yuan =678 diamonds ## 268 yuan =1868 diamonds ## Iap_items = [{"id" => "07", "reference" => "6 $= 36 diamonds ", "Tier" => "1"}, {" id "= >" 08 ", "reference" = > "18 yuan = 120 diamond", "tier" = > "3"}, {" id "= >" 09 ", "reference" = > "RMB 30 = 206 diamond", "Tier" = > "7"}, {" id "= >" 10 ", "reference" = > "98 yuan = 678 diamond", "tier" = > "15"}, {" id "= >" 11 ", "Reference" = > "$268 = 1868 diamond", "tier" = > "42"}, {" id "= >" 12 ", "reference" = > "548 yuan = 3828 diamond", "tier" = > "57"}, ] puts "-- -- -- -- -- -- -- begin to create the purchasing project -- -- -- -- -- -- --" iap_items. Each do | item | puts "are created within the purchasing project: # {item [" reference"]} "# # the actual creation command app.in_app_purchases.create! (# # purchase type type: Spaceship: : the itunes: : IAPType: : CONSUMABLE, internationalization of # # description information versions: {" useful - Hans "= > {name: item["reference"].gsub(/\s+/, ""), description: item["reference"] } }, cleared_for_sale: true, reference_name: item["reference"].gsub(/\s+/, ""), product_id: "#{iap_id}#{item["id"]}", review_notes: nil, review_screenshot: Pricing_enjoyth: [{country: "WW", begin_date: nil, end_date: nil, tier: Item [r]. "tier" to_i}]) end puts "-- -- -- -- -- -- -- to create the projects end -- -- -- -- -- -- --"Copy the code
Reference documentation
- Github.com/fastlane/fa…
- Github.com/fastlane/fa…
- Github.com/fastlane/fa…
- Github.com/fastlane/fa…
- Andreygordeev.com/2017/09/14/…