-
Notifications
You must be signed in to change notification settings - Fork 319
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
Testing macOS IAP in sandbox #2558
Comments
👀 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out! |
@beeloo42 thanks for reporting!!
I have a feeling that what might be happening internally is that |
@aboedo thanks for replying!! :) |
I can reproduce. It didn't happen to me the first time, weirdly enough, but after making the first purchase, I get the same result. Interesting thing is that the receipt is there, it's just an empty file. |
I'm going to file a radar, including a sample app that can be used to easily reproduce. I sincerely wish there was more we could do here, but without a receipt, it's basically impossible for us to process a purchase. Thanks for reporting! |
Filed as |
If you have been able to reproduce, did get a chance to debug ? Here are some logs of 4.21.0. on start:
(looping last lines of previous logs 113 times)
(...merged with some of the previous loop., and also..)
(...then looping again, and also...)
(...then looping again, and also...)
on .purchase:
on . restorePurchases:
|
I'm not sure, but I think the bugs are located in the RevenueCat framework. |
Any updates on this issue? running into a Details:
Logs:
|
Using StoreKit 2 directly, I can purchase and parse the receipt |
SOLUTION: the file path for the receipt saves in the wrong location. Go to Product (in XCode Toolbar) --> Show Build Folder in Finder Expected File path: /Build/Products/Debug/[App Name].app/Contents/PlugIns/[Extension name].appex/Contents/_MASReceipt/receipt Actual File path: /Build/Products/Debug/[App Name].app/Contents/_MASReceipt/receipt Moving the '_MASReceipt' folder to the correct place makes it that we can see the purchases in RC sandbox accounts. |
Interesting, did you find the receipt in The |
I found it in Build/Products/Debug/[App Name].app/Contents/_MASReceipt/receipt but it was looking for it in the first file path you mentioned |
@hma17 thanks for reporting! I guess it's time for another StoreKit Bug Workaround ™️ |
Looking into this right now.
The SDK uses
I imagine you redacted that, but this is the bundle we're using to look up |
It appears that the problem here is that the receipt is empty after a successful purchase in sandbox, which is a bug. |
I wanted to support it to be able to look into #2558.
…ntext Added `rc_receipt_url` and `rc_receipt_file_exists`. This is useful when debugging issues like #2558. Example: ``` [Purchases] - ERROR: 💰 Product purchase for 'rc_1099_1w' failed with error: Error Domain=RevenueCat.ErrorCode Code=9 "The receipt is missing." UserInfo={NSLocalizedDescription=The receipt is missing., readable_error_code=MISSING_RECEIPT_FILE, source_function=handlePurchasedTransaction(_:data:completion:), rc_receipt_url=file:///.../Build/Products/Debug/...app/Contents/_MASReceipt/receipt, rc_receipt_file_exists=true, source_file=RevenueCat/TransactionPoster.swift:96} ```
…ntext (#2650) Added `rc_receipt_url` and `rc_receipt_file_exists`. This is useful when debugging issues like #2558. This goes from this: > [Purchases] - ERROR: 💰 Product purchase for 'rc_1099_1w' failed with error: Error Domain=RevenueCat.ErrorCode Code=9 "The receipt is missing." UserInfo={NSLocalizedDescription=The receipt is missing., readable_error_code=MISSING_RECEIPT_FILE, source_function=handlePurchasedTransaction(_:data:completion:), source_file=RevenueCat/TransactionPoster.swift:96} To this: > [Purchases] - ERROR: 💰 Product purchase for 'rc_1099_1w' failed with error: Error Domain=RevenueCat.ErrorCode Code=9 "The receipt is missing." UserInfo={NSLocalizedDescription=The receipt is missing., readable_error_code=MISSING_RECEIPT_FILE, source_function=handlePurchasedTransaction(_:data:completion:), rc_receipt_url=file:///.../Build/Products/Debug/...app/Contents/_MASReceipt/receipt, rc_receipt_file_exists=true, source_file=RevenueCat/TransactionPoster.swift:96} In this case, we can see the file does exist, so it must be empty.
I wanted to support it to be able to look into #2558. ![image](https://github.com/RevenueCat/purchases-ios/assets/685609/cdba0488-965e-4887-bef0-ae151430889a)
Useful when debugging issues like #2558.
Useful when debugging issues like #2558. ![Screenshot 2023-06-14 at 11 58 28](https://github.com/RevenueCat/purchases-ios/assets/685609/3fcb55bc-107e-46fd-aced-0d12d0667cba)
@NachoSoto Thanks for the reply! After looking into this we found that The initial solution I mentioned in this thread still works - where we move the receipt folder to the extension's content folder from the main app content folder where it saves initially Our receipt is not empty after a purchase, but it looks like the SDK is saving the receipt folder in the main app, rather than in the extension. |
The SDK doesn't save the receipt itself, that's done by We might be able to add a configuration parameter to |
@NachoSoto Hi! I'm working with @hma17. We're configuring the SDK from an extension target. Could we set up some time to chat through zoom and walk through the issue/setup? :) |
Yeah that would be great, I’d love to understand your setup better to see how the SDK can work out of the box. Mind sending an email to [email protected]? |
Wondering if any movement on this? I'm getting the same error but I'm not using an app extension. Receipt file is 0 bytes. RevenueCat is also not seeing the purchase. |
I am having this issue with a macos app using the flutter SDK as well. My bundle does not have a plugins folder.
the file at This seems like a pretty big issue. Is there any updates on this? |
Is this still an active issue? I'm just implementing IAP in my app now .. should I move away from Revenuecat? |
We're in late beta stages with full end-to-end StoreKit 2 support, which should fix this issue for anyone on macOS. |
This isn't an Apple side issue. |
Describe the bug
In sandbox, when running a macOS app with .storekit configuration, even if it's launched with Xcode or Finder, the StoreKit products are visible. But when one of them is purchased, or when restoring purchase, the error is: The receipt is missing.
Otherwise, in the StoreKit transaction debugger, Xcode says "⚠️ The transaction has not been finished by calling [SKPaymentQueue finishTransaction:]", on each "purchased" product
In other terms, RevenueCat in sandbox IAP environment can't tell which entitlement is active.
Environment
useStoreKit2IfEnabled(false)
) (Y/N): NoDebug logs that reproduce the issue
On .purchase call:
On .restorePurchases call:
Add needed products on RevenueCat.com and follow the guides to configure the SDK in a macOS app.
Configure the .storekit file and link it into the app's scheme in Xcode.
Login with a valid sandbox user in App Store.
Build app to call
.purchase(package: Package) async throws
Build app to call
.restorePurchases(completion: ((CustomerInfo?, PublicError?) -> Void)?)
.Both calls fail with error
The receipt is missing
.Open Xcode's StoreKit Transactions.
Observe that transactions are not finished (see screenshot).
It's expected to successfully purchase a product, generate a receipt, and to return the active entitlement through the CustomerInfo.
The text was updated successfully, but these errors were encountered: