-
Notifications
You must be signed in to change notification settings - Fork 331
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
Purchase sheet may fail to appear on iOS 18.2 #4611
Comments
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out! |
Hi @inb4ohnoes, Thanks for reporting this. Indeed it seems like StoreKit payments fail 100% of the time in App Extensions. I've added a workaround specifically for App Extensions to the |
Thanks so much @MarkVillacampa, I'll try this as soon as I get home and report back! |
Ok just tried that branch and it seems to be working. I'll try to rush my build through review and see if customers are still seeing the issue. Thanks! |
Does anyonw knows if this bug could affect the react native package ? |
same question about flutter https://x.com/luke_pighetti/status/1871180719692886062 |
@Lakston @lukepighetti the short answer is "yes it could" The bug is not specific to the RevenueCat SDK or the UI framework you're using, but to StoreKit, Apple's iOS framework for in-app purchases. The best way to test if your app is affected is trying to make a purchase on an iOS 18.2 device or simulator. If the purchases sheet pops up that means your app is not affected. |
Hi, @MarkVillacampa . Could you please let me know when the bug fix will be released? We are encountering the same error and cannot determine the specific version related to this issue, as we are using the RevenueCat SDK, which depends on version 5.14.4. |
Hi @MarkVillacampa , Reviewer message: Review device details:
|
Hello @amucahidbozkurt, Are you able to reproduce the issue on your own device or simulator in the Sandbox environment, and specifically seeing the "Could not get confirmation scene ID for" message in the Console? Asking because in the issue you mention "missing products" rather than not being able to purchase the products which is an issue thay is sometimes common when submitting an app for review whith newly created products. |
I have 4 apps in production from the same source of code. they are different only in JSON files used as sources. Is it some kind of sanctions from Revenue cat? Guys please put attention on this @revenuecat-ops @RCGitBot @revenuecat-circleci-ios-certs @aboedo this is so critical because people loosing money and customers
but the most crazies moment here is that the same builds works fine on other devices: |
Same problem, sometimes I'm getting the error "There was a problem with the App Store.", but if payment sheet gets open - the free trial information is missing even if product has correctly set a free trial. |
@FurkanHanciSecond sorry to hear you're hitting this issue. I'm hoping the recommendations from the issue details can help you track down the root cause of the bug in your app and potentially fix the issue. @astrokin I believe your apps are experiencing this exact issue, but it's not relaxed to the country of origin. I was able to download your apps and reproduce the issue where the payment sheet does not pop up and I can see the message @euroboy If payment sheet does not open sometimes, it can be because of this issue. Do you see the To all three, if you're unable to track down the issue in your apps please write to me at mark (at) revenuecat.com and I will try to help you personally. |
@MarkVillacampa thank you for the answer and especially thank you for testing my app. Could you please explain how the console message It would be great if you could give more details about the error and how to possibly fix it. As far as I understand it's not UI related issue. Sorry if I've missed something |
Hi @astrokin, when the issue presents itself, StoreKit prints The underlying bug is actually UI related. StoreKit can't present the payment sheet because it cannot find a view to do it. This can happen when you're presenting a modal view controller with |
Hi, React Native also seems to affected, at least in my testing on real device with iOs 18.2.1. Is there any workaround? I have tried both a modal and a separate screen/View to no avail, the subscription is processed correctly but when trying to return the purchase info StoreKit.StoreKitError is thrown. |
@butterfly-valley Hi! You mention "the subscription is processed correctly", does this mean the purchase sheet with the price, etc opens up? If you can open the purchase sheet then this is a different issue. |
The subscription is processed correctly because it is active in the sandbox account. I can cancel it and purchase it again and again but there is no visual confirmation and this error is thrown. |
It might have a user error from my side. I have implemented the workflow on Android, pushed the code and tested on iOs with no issues. Please accept my apologies. |
@Toni77777 do you also see the @butterfly-valley glad to know it's working for you now :) |
UPDATE 2025/01/22: It seems iOS 18.3 RC fixes this issue and will be generally available very soon.
There's a bug introduced by Apple in iOS 18.2 which prevents the payment sheet from being displayed if the current scene's key window root view controller is not part of the view hierarchy.
When the issue manifests, there is a log error message printed in the console:
Could not get confirmation scene ID for
This can happen if it is currently presenting a modal view controller with:
modalPresentationStyle = .fullScreen
on UIKitfullScreenCover(isPresented:onDismiss:content:)
in SwiftUITo workaround the issue:
modalPresentationStyle = .overFullScreen
on UIKitsheet(isPresented:onDismiss:content:)
on SwiftUIIf your app manifests the issue but these workarounds do not apply to your view structure, make sure your root view controller is part of the view hierarchy when initiating a purchase.
We're working on a workaround so purchases continue to work for users of our SDK: #4610
Technical details
Apple added a new purchase method in iOS 18.2 which accepts a
UIViewController
, as well as a macOS 15.2 one that accepts anNSWindow
.https://developer.apple.com/documentation/storekit/product/purchase(confirmin:options:)-3bivf
https://developer.apple.com/documentation/storekit/product/purchase(confirmin:options:)-8eai6
All the purchase methods were reimplemented internally, and the old
purchase(confirmIn:scene)
andpurchase(options:)
methods end up calling the newpurchase(confirmIn:viewController)
method.To select which
UIViewController
to pass as parameter, the algorithm roughly translates to:UIApplication.shared.connectedScenes.filter { $0.activationState == .foregroundActive }?.keyWindow?.rootViewController
However, when you present a view controller with
modalPresentationStyle = .fullScreen
over therootViewController
the documentation says:The views belonging to the presenting view controller are removed after the presentation completes.
This is equivalent to doing:
Which sure enough produces the dreaded
Could not get confirmation scene ID for message
.The text was updated successfully, but these errors were encountered: