Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joshdholtz opened this issue Jul 18, 2022 · 32 comments · May be fixed by #20996
Open

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

joshdholtz opened this issue Jul 18, 2022 · 32 comments · May be fixed by #20996

Comments

@joshdholtz
Copy link
Member

joshdholtz commented Jul 18, 2022

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

@vchrbch
Copy link

vchrbch commented Jul 19, 2022

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

@WackyShady
Copy link

same issue, waiting for your solution.

@joshdholtz
Copy link
Member Author

@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
Copy link

vchrbch commented Jul 19, 2022

@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.

@sandy-boop
Copy link

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

@sandy-boop
Copy link

@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

@devconcappt
Copy link

Same problem here. Would love to see a fix! ❤️ 🙏

@valerio-castelli
Copy link
Contributor

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? 🙂

@joshdholtz
Copy link
Member Author

joshdholtz commented Sep 9, 2022

✨ 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! 😅

@joshdholtz
Copy link
Member Author

@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 😇

@valerio-castelli
Copy link
Contributor

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. 🙁

@joshdholtz
Copy link
Member Author

@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 😊

@valerio-castelli
Copy link
Contributor

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! ❤️

@valerio-castelli
Copy link
Contributor

valerio-castelli commented Sep 12, 2022

@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 🙂

@anta-semenov
Copy link

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

@joshdholtz
Copy link
Member Author

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!

@anta-semenov
Copy link

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!

@valerio-castelli
Copy link
Contributor

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. 🙂

@fastlane-bot
Copy link

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.

@anta-semenov
Copy link

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

@fishandphil
Copy link

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

@kaulex99
Copy link

kaulex99 commented Dec 22, 2022

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

@wade0317
Copy link

wade0317 commented Jan 4, 2023

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

@oklimberg
Copy link
Contributor

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.

@addbrick
Copy link
Contributor

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.

@addbrick
Copy link
Contributor

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

@mofish9
Copy link

mofish9 commented Feb 10, 2023

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

@addbrick
Copy link
Contributor

addbrick commented Feb 13, 2023

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

@laughingsir
Copy link

laughingsir commented Feb 16, 2023

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 !

@addbrick
Copy link
Contributor

@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

@andrewdieken
Copy link

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?

@juAlberti
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet