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 Purchase sanbox reopens repeatedly and does not send purchased status in stream #138134

Closed
hamadJamal opened this issue Nov 9, 2023 · 11 comments
Labels
r: solved Issue is closed as solved

Comments

@hamadJamal
Copy link

hamadJamal commented Nov 9, 2023

I am facing a weird issue while making auto renewable subscription through in_app_purchase package in IOS simulator 17.0.

What works well:

  1. I am able to fetch my subscription product from the app store.
    Future<void> _getProducts() async { ProductDetailsResponse response = await _iap.queryProductDetails(productIds.toSet()); if (response.notFoundIDs.isNotEmpty) { print('These products were not found: ${response.notFoundIDs.join(', ')}'); } _products = response.productDetails; notifyListeners(); }

  2. I am able to open the sandbox and start the pruchase using sanbox tester account in the apple app store.
    Future<void> buyProduct(ProductDetails product) async { final PurchaseParam purchaseParam = PurchaseParam(productDetails: product); try { await _iap.buyNonConsumable(purchaseParam: purchaseParam); } catch (e) { print("$e"); } }

  3. The sanbox shows the "DONE" UI, but I NEVER get the PurchasedStatus.purchased in my stream, and the sandbox reopens again.

  4. The cycle repeats

Here is the output of my flutter doctor -v

Details

[✓] Flutter (Channel stable, 3.13.1, on macOS 14.0 23A344 darwin-x64, locale en-GB)
    • Flutter version 3.13.1 on channel stable at /Users/muhammadhamadjamal/Documents/FlutterDev/sdk/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision e1e47221e8 (3 months ago), 2023-08-22 21:43:18 -0700
    • Engine revision b20183e040
    • Dart version 3.1.0
    • DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/muhammadhamadjamal/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.84.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.76.0

[✓] Connected device (3 available)
    • iPhone 15 Pro Max (mobile) • DC9EDD04-0B17-4D27-BD2A-966F06BFCF7F • ios            •
      com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator)
    • macOS (desktop)            • macos                                • darwin-x64     • macOS 14.0 23A344 darwin-x64
    • Chrome (web)               • chrome                               • web-javascript • Google Chrome 119.0.6045.105

[✓] Network resources
    • All expected network resources are available.

• No issues found!

@dam-ease Here is the preview of issue for your understanding
https://www.loom.com/share/0a483d3dcba44807bec0a38e0a752e66?sid=faf18c39-f93f-47a0-8ed2-fc4e867c99b2

@dam-ease dam-ease added the in triage Presently being triaged by the triage team label Nov 9, 2023
@dam-ease
Copy link

dam-ease commented Nov 9, 2023

Hi @hamadJamal. Thanks for filing this. From your description, this seems to be related to Auto-Renewable Subscription not expiring while in Sandbox which could be similar/related to #36682. Can you check this out??

@dam-ease dam-ease added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 9, 2023
@hamadJamal
Copy link
Author

Hi @dam-ease,
Thank for your response. I dont think it is an issue with subscription expiration becuase I tried creating fresh sanbox tester, but still was facing same issue. Also, another expected behavior is when I call

await _iap.restorePurchases();
Screenshot 2023-11-09 at 5 34 48 PM
I get this SKError exception.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 9, 2023
@hamadJamal
Copy link
Author

hamadJamal commented Nov 9, 2023

@anaisbetts
Copy link
Contributor

Why are you CCing me

@dam-ease
Copy link

Hi @hamadJamal. Thanks for your detailed response. Does this issue only occur on iOS 17? Are you able to try this on another iOS version (emulator or real device) or Android?

@dam-ease dam-ease added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 10, 2023
@hamadJamal
Copy link
Author

hamadJamal commented Nov 10, 2023

Hi, @dam-ease,
I neither have an physical device, nor I am able to test on another emulator version because of my xcode. Currently I am only working on IAP for subscription for apple, dont have to support android yet.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 10, 2023
@dam-ease
Copy link

Thanks for your response. Can you please provide a minimal complete reproducible code sample that doesn’t include 3rd party plugins or complex production code that we could use to reproduce this on our end?

@dam-ease dam-ease added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 10, 2023
@lukeirvin
Copy link

Hello. To note, I am facing this same issue. Everything works great on Android, but on iOS, once I get the success message, the purchased status never occurs.

@hamadJamal
Copy link
Author

@dam-ease I think I missed a major point here. I was running my in-app autorenewable purchase process in an ios simulator without Configuration.storkit setup, as I have my products setup in app store connect already. Now I did local storekit setup by syncing it with appstore connect locally using xcode, the purchase process worked flawlessly.

is this an expected behavior? because I see this setup in the example project of in app purchase as well. Please correct me if I am wrong.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Nov 10, 2023
@dam-ease
Copy link

Thanks for your response. Yes, this is the expected behaviour as seen in the example project as well.
I'll be closing this as solved, if you disagree, please comment and I'll reopen this.
Thank you!

@dam-ease dam-ease added r: solved Issue is closed as solved and removed in triage Presently being triaged by the triage team labels Nov 13, 2023
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: solved Issue is closed as solved
Projects
None yet
Development

No branches or pull requests

4 participants