Skip to content

[spaceship] fix fastlane init and temporarily retrofitting Spaceship::Tunes::Application.find#20480

Merged
joshdholtz merged 9 commits intomasterfrom
joshdholtz-fix-init
Jul 19, 2022
Merged

[spaceship] fix fastlane init and temporarily retrofitting Spaceship::Tunes::Application.find#20480
joshdholtz merged 9 commits intomasterfrom
joshdholtz-fix-init

Conversation

@joshdholtz
Copy link
Copy Markdown
Member

@joshdholtz joshdholtz commented Jul 19, 2022

Motivation and Context


Description

❌ The legacy Apple endpoint that Spaceship::Tunes::Application.find used is no longer available

This was not an issue for anything inside of fastlane (besides fastlane init still accidentally using it).

Fix 1 - fastlane init

This was the easy fix. setup_ios.rb now uses Spaceship::ConnectAPI::App.find instead. This uses the more stable Apple API now.

Fix 2 - Retrofit Spaceship::Tunes::Application.find

Because some users (and I think App Center) still want/need to use Spaceship::Tunes for in-app purchase things, I have done by best to retrofit Spaceship::Tunes:: Application.find by power it with Spaceship::ConnectAPI::App.find.

It's not a perfect fit because not all of the data is available but it will at least find the app and be able to give the app name, id and platforms.


Testing Steps

Update Gemfile and run bundle install, bundle update fastlane, or bundle update

gem "fastlane", :git => "https://github.com/fastlane/fastlane.git", :branch => "joshdholtz-fix-init"

Other Notes

‼️ IT IS STILL HIGHLY RECOMMEND TO USE STOP USING Spaceship::Tunes START USING Spaceship::ConnectAPI if you can

⚠️ However, there is not official Spaceship::ConnectAPI support for in-app purchases (yet) but I'm working on it. You can follow along with progress on this issue for now - #20477

@fastlane-bot-helper
Copy link
Copy Markdown
Contributor

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

@joshdholtz joshdholtz changed the title Commiting before i go crazy [spaceship] temporary fix for Spaceship::Tunes::Application.find Jul 19, 2022
@joshdholtz joshdholtz force-pushed the joshdholtz-fix-init branch from 847000c to bbe1160 Compare July 19, 2022 03:31
@joshdholtz joshdholtz changed the title [spaceship] temporary fix for Spaceship::Tunes::Application.find [spaceship] fix fastlane init and temporary fix for Spaceship::Tunes::Application.find Jul 19, 2022
@joshdholtz joshdholtz changed the title [spaceship] fix fastlane init and temporary fix for Spaceship::Tunes::Application.find [spaceship] fix fastlane init and temporarily retrofitting Spaceship::Tunes::Application.find Jul 19, 2022
@mjlaser
Copy link
Copy Markdown

mjlaser commented Jul 19, 2022

Regarding #20444 (comment).

That is all! So sorry about this taking so long. It ended up being a pretty back task to retrofit but I'm hoping it works out for some of you.

I am one of the users who is using the Tunes API for IAP uploads. Thanks for working on a fix to get us up and running again so quickly!

If any of you are able to test this PR / branch to make sure the retrofit is working for you that would be fire I need to go to bed now so I'll look at any response in the morning blush

I just tested your fix in our IAP automation project. It looks like things are working. Here are a subset of the API calls we are making. Let me know if you need more information to verify @joshdholtz.

client = Spaceship::Tunes.login(username, password)
client.select_team(team_id: team_id)
@app = Spaceship::Application.find(@app_id)
@app.in_app_purchases.create!(...)
@app.in_app_purchases.all.find { ... }

Looking forward to being able to use the ConnectAPI when it is available at some point in the future!

@joshdholtz
Copy link
Copy Markdown
Member Author

@mjlaser Thank you for testing! BTW... do you mind dropping me an email at me AT joshholtz DOT com? 😊 I'd like to loop you into that early IAP testing if possible to make sure it works for you!

Copy link
Copy Markdown

@fastlane-bot fastlane-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulations! 🎉 This was released as part of fastlane 2.208.0 🚀

@jafarlow
Copy link
Copy Markdown

Thank you very much for putting this together! I can confirm I am now able to successfully distribute from App Center into App Store Connect like normal. 🙏 🎉

@rafaelnobrekz
Copy link
Copy Markdown

@joshdholtz The temporary solution for IAP management did the trick to unblock my pending bulk uploading, thanks! 👍
We use the following API:

spaceship = Spaceship::Tunes.login(apple_id)
spaceship.team_id = itc_team_id
app = Spaceship::Tunes::Application.find(app_identifier)
app.in_app_purchases.create!
app.in_app_purchases.all

@sandy-boop
Copy link
Copy Markdown

Regarding #20444 (comment).

That is all! So sorry about this taking so long. It ended up being a pretty back task to retrofit but I'm hoping it works out for some of you.

I am one of the users who is using the Tunes API for IAP uploads. Thanks for working on a fix to get us up and running again so quickly!

If any of you are able to test this PR / branch to make sure the retrofit is working for you that would be fire I need to go to bed now so I'll look at any response in the morning blush

I just tested your fix in our IAP automation project. It looks like things are working. Here are a subset of the API calls we are making. Let me know if you need more information to verify @joshdholtz.

client = Spaceship::Tunes.login(username, password)
client.select_team(team_id: team_id)
@app = Spaceship::Application.find(@app_id)
@app.in_app_purchases.create!(...)
@app.in_app_purchases.all.find { ... }

Looking forward to being able to use the ConnectAPI when it is available at some point in the future!

hello,Can you upload IAP now? I haven't succeeded here. I'll prompt undefined method ` in_ app_ purchases' for #Spaceship::ConnectAPI::App:0x00007facb1335f58 (NoMethodError)
my code
require 'spaceship'
Spaceship::ConnectAPI.login("h", "Wa3")
app = Spaceship::ConnectAPI::App.find("cw")

app.in_app_purchases.create!(
type: Spaceship::ConnectAPI::IAPType::CONSUMABLE,
versions: {
'zh-Hans': { name:"30b", description:"30a" },

@wade0317
Copy link
Copy Markdown

create auto iap still failed now

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

undefined method `include?' for nil:NilClass (NoMethodError)

8 participants