fastlane/fastlane

In-App Purchases - Deprecate Spaceship::Tune's IAP and replace with Spaceship::ConnectAPI

joshdholtz opened this issue Β· 33 comments

Problem

In-app purchase are slightly/mostly broken using Spaceship::Tunes. The APIs that Spaceship::Tunes has been using will be going away in favor of the new App Store Connect API endpoints.

Solution

Anything using Spaceship::Tunes will need to migrate to new functionality on Spaceship::ConnectAPI

However, there a lot of new endpoints and we are going to want to auto-generate this code. There will be a WIP / beta pull request up hopefully soonℒ️ to get people started on and get early feedback.

Temporary Solution / Work Around

Coming soon

I am using fastlane only to create IAP in Apple Store and update prices. these functions don't work for 12 days already.

Is any planned date for patch/fix? or work around? Or better try to find some other option for my needs? Thanks

same issue, waiting for your solution.

@vchrbch @WackyShady I have a patch in 2.208.0 (which I just released this morning) that fixes Spaceship::Tunes::Application.all and Spaceship::Tunes::Application.find

You should be able to use that again until it breaks again 😊

But I'll get a new Spaceship::ConnectAPI version of IAPs up as soon as I can!

@vchrbch @WackyShady I have a patch in 2.208.0 (which I just released this morning) that fixes Spaceship::Tunes::Application.all and Spaceship::Tunes::Application.find

You should be able to use that again until it breaks again 😊

But I'll get a new Spaceship::ConnectAPI version of IAPs up as soon as I can!

THANKS.

I am using fastlane only to create IAP in Apple Store and update prices. these functions don't work for 12 days already.

Is any planned date for patch/fix? or work around? Or better try to find some other option for my needs? Thanks

hello , Have you solved your problem? I have the same problem now. I can't upload IAP. What's your solution

@vchrbch @WackyShady I have a patch in 2.208.0 (which I just released this morning) that fixes Spaceship::Tunes::Application.all and Spaceship::Tunes::Application.find

You should be able to use that again until it breaks again 😊

But I'll get a new Spaceship::ConnectAPI version of IAPs up as soon as I can!

hello , Have you solved your problem? I have the same problem now. I can't upload IAP. What's your solution

Same problem here. Would love to see a fix! ❀️ πŸ™

I'm sorry to be bearer of bad news, but it seems like Apple dropped the remaining IAPs endpoints today. Are there any plans to work on this update soon? πŸ™‚

✨ OFFICIAL UPDATE

Oh nooooo 😱 I didn't know they were going to drop them so soon 😬 I've been out almost 3 weeks with whole house getting sick and some other personal issues so I'm really far behind on this...

I will see what I can try to get put together this weekend! πŸ˜…

@valerio-castelli Do you have a sample script you can me of all the IAP calls that you do? Just want to make sure I cover everything πŸ˜‡

I can try to provide you with something πŸ™‚

So far I can confirm that any call to the all method of the IAP factory results in a broken response:

INFO -- response: {"data":null,"messages":{"warn":null,"error":["Not Found"],"info":null},"statusCode":"ERROR"}

So it looks like this endpoint:

GET https://appstoreconnect.apple.com/WebObjects/iTunesConnect.woa/ra/apps/<apple_id>/iaps

has been deprecated.

I haven't tried other operations yet because our codebase does further operations based on the result of this one. However, I can tell you that we rely on families.all, that we access the pricing_intervals property (among others) and that we call the create!, edit, and save! methods.

I don't really have a standalone script that I can share because these operations are part of a more complex pipeline, but I can do some more digging if needed to provide additional information on our operations. At a high level, we do both read and write operations on IAPs. I've briefly looked at the documentation for the new endpoints and it looks like auto renewable subscriptions are now managed differently from everything else, which may be a bit of a problem to handle. πŸ™

@valerio-castelli Thank you! My guess is that all of them are now gone πŸ€·β€β™‚οΈ I'm working on getting an OpenAPI generator against the ASC API spec so that we don't have to manually create all the models and endpoints anymore.

This will eventually replace all of the custom Spaceship::ConnectAPI logic when we release fastlane v3 but for now the IAP is going to use this in v2.

I have a the proof of concept working but I want to make sure its design into fastlane and spaceship in a way where its easy to grow and adapt with it in the future.

I'll most likely having something working be Monday but it might be on a separate branch if you are okay using that 😊

That would be absolutely great! No problem using a beta branch for us, we can work on testing it and incorporating it into our pipelines as soon as it's ready, in order to give you quick feedback. Thanks for the amazing work, as always it's super appreciated! ❀️

@joshdholtz I've just tried the endpoints again and it looks like they've been "temporarily resurrected" by Apple – I've performed both a fetch operation and an upload operation, which included the creation of new subscription groups and new subscriptions, and they all worked. πŸŽ‰

I'd say this reduces the urgency of this fix a bit, although we definitely can't be sure of how long it'll take before Apple pulls the plug as well πŸ™‚

@joshdholtz any updates on this? Is there a way to contribute to this somehow?

Hey, sorry! My wife and I had our new baby girl arrive early so had to disconnect for a bit.

But I should have time Friday and Saturday and publish my beta branch for this!

Hey, sorry! My wife and I had our new baby girl arrive early so had to disconnect for a bit.

But I should have time Friday and Saturday and publish my beta branch for this!

Wow, congrats! Hope everything is ok with your wife and baby!

Super congrats for the birth of your child, Josh! πŸ™‚

Thanks for taking the time to publish the beta branch for this feature, but really, don't feel compelled to do it. As important as these changes may be for the community, being a dad is so much more important than that. πŸ™‚

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest fastlane version and check if that solves the issue. Let us know if that works for you by adding a comment πŸ‘

Friendly reminder: contributions are always welcome! Check out CONTRIBUTING.md for more information on how to help with fastlane and feel free to tackle this issue yourself πŸ’ͺ

This issue will be auto-closed if there is no reply within 1 month.

@joshdholtz any updates on this? Is there a way to contribute to this somehow? Would really glad to help if it's possible

Would also love to hear if there is an update. We were using spaceship to create IAPs with a script which was super handy!

As we want to automatically create the IAP for 2023 we are really blocked by this.

there is a new branch for creating iap by conenct api. but i do not known whether it works now?

I had a quick look into the branch and as far as I understood the code, there are currently only methods to poll the existing IAP Items and Subscriptions. So currently no possibility to create them.

Just a note, I am working on implementing a lot of basic create, update and delete calls for the subscription and one time purchases and all their related metadata. I expect to have a PR by the end of this week. It is building off of Josh's existing branch which setup the basics.

I have opened the preliminary PR introducing a lot of the basic create and manage calls #20996

Maintaining the IAP related data is an important function and it needs to be migrated to the new ConnectAPI. It is a pity that it is still not working in 2023.2

@mofish9 use the branch from my pr. It has implemented most of the creation and management calls for subscriptions and in-app purchases. #20996

I have opened the preliminary PR introducing a lot of the basic create and manage calls #20996
@addbrick I used gem to install fastlane, how to use your pr to compile fastlane or how to use source code to compile it?I can't find a tutorial to compile with source code on the https://docs.fastlane.tools/ . can you give me a doc link . thanks !

@laughingsir You do not need to compile this. Please look up the concept of ruby gems to understand how to use this. As far as I am aware we do not have generated docs for the connect api yet. You can refer to the apple api and line it up with what has been implemented in the gem. https://developer.apple.com/documentation/appstoreconnectapi/app_store

Commenting here first instead of opening a new issue to see if it's related.

I'm attempting to release a new app and am running into the error described here. The suggested fix resolves the error I was running into but I am now unable to add the app for review because the price tier is not being set and am having to complete the Pricing and Availability section manually within App Store Connect.

Screenshot 2023-06-26 at 11 34 06 AM

I'm using Fastlane v2.213.0 running the command fastlane deliver --overwrite_screenshots true --force true. I am setting the price tier to 0 within my Deliverfile

Screenshot 2023-06-26 at 11 46 10 AM

Has anyone else run into this issue and if yes know of any workarounds?

Hello everyone, I've been facing a problem with Spaceship::Tune's API, since it was deprecate.
I'll leave it here for what I wanted to use and how we solved the error.
I was looking for how to upload the app to all countries with fastlane. Unfortunately we ran into problems that even chatGPT couldn't help with.
We solved it by reading the Spaceship documentation, and here's the code snippet:

app = Spaceship::ConnectAPI::App.find(YOUR_APP_ID)

attributes_prices = {}
territory_ids = []
attributes_prices[:availableInNewTerritories] = true
price_tier = "0".to_s
territory_ids = Spaceship::ConnectAPI::Territory.all.map(&:id)
app.update(attributes: attributes_prices, app_price_tier_id: price_tier, territory_ids: territory_ids)

I hope it helps someone!