Skip to content

[in_app_purchase] PigeonError after enabling StoreKit2 #159843

Closed

Description

@bahadirarslan

Steps to reproduce

Hi,

I tried enableStoreKit2 flag with my current working code.
InAppPurchaseStoreKitPlatform.enableStoreKit2();

But I got an error while trying to purchase

By the way, I am trying on simulator with StoreKit configuration. I run the app from Xcode.
in_app_purchase_storekit version 0.3.20+2

Expected results

Expecting to complete transaction

Actual results

Failed to send transaction updates: in_app_purchase_storekit.PigeonError

Code sample

Future<void> buy(BuildContext buildContext, PurchasableProduct product) async {
    context = buildContext;
    if (Platform.isIOS || Platform.isMacOS) {
      var transactions = await SKPaymentQueueWrapper().transactions();
      for (var skPaymentTransactionWrapper in transactions) {
        SKPaymentQueueWrapper().finishTransaction(skPaymentTransactionWrapper);
      }
    }
    final purchaseParam = PurchaseParam(productDetails: product.productDetails);
    switch (product.id) {
      case storeKeyMontlySubscription:
      case storeKeyYearlySubscription:
      case storeKeyLifeTimeSubscription:
        await iapConnection.buyNonConsumable(purchaseParam: purchaseParam);
        break;
      default:
        throw ArgumentError.value(product.productDetails, '${product.id} is not a known product');
    }
  }

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
bahadirarslan@bahadirsmac ios % flutter doctor -v
[✓] Flutter (Channel stable, 3.24.5, on macOS 15.1 24B83 darwin-arm64, locale en-TR)
    • Flutter version 3.24.5 on channel stable at /Users/bahadirarslan/Development/SDKS/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision dec2ee5c1f (3 weeks ago), 2024-11-13 11:13:06 -0800
    • Engine revision a18df97ca5
    • Dart version 3.5.4
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at /Users/bahadirarslan/Library/Android/sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16B40
    • CocoaPods version 1.15.2

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

[✓] Android Studio (version 2024.2)
    • 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 21.0.3+-79915917-b509.11)

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

[✓] Connected device (6 available)            
    • Bahadır’s iPhone (mobile)       • 00008120-00120CC93663C01E            • ios            • iOS 18.1.1 22B91
    • Bahadir Arslan’s iPad (mobile)  • 00008112-001911EE0CE8A01E            • ios            • iOS 17.4.1 21E236
    • iPhone 16 Pro (mobile)          • EDF9C0DB-F912-4F18-9568-FEE2A10523B6 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-1 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 15.1 24B83 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 15.1 24B83 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 131.0.6778.87
    ! Error: Browsing on the local area network for Bahadır's iPad. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

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

• No issues found!

Activity

  1. changed the title [-][in_app_purchase] PigenError after enabling StoreKit2[/-] [+][in_app_purchase] PigeonError after enabling StoreKit2[/+] on Dec 5, 2024
  2. darshankawar commented on Dec 6, 2024

    @darshankawar
    Member

    Thanks for the report @bahadirarslan
    Although the error looks genuine, can you try to provide us complete runnable code ?
    I tried with plugin example but maybe missing a step to replicate properly.

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Dec 6, 2024
  4. bahadirarslan commented on Dec 8, 2024

    @bahadirarslan
    Author

    I will try to provide but it won't be easy. Because I just added InAppPurchaseStoreKitPlatform.enableStoreKit2(); code to my running app.

    The only thing that can cause this problem is I used StoreKit configuration file to purchase on simulator.

    Is there any guide to follow for integration with recent changes?

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Dec 8, 2024
  6. darshankawar commented on Dec 9, 2024

    @darshankawar
    Member

    I will keep the issue open for team's tracking. Based on #159844, it seems to be a genuine error, although this is something you can check for reference. Once you have a reproducible code, please share it here for further debug.

  7. added
    platform-iosiOS applications specifically
    packageflutter/packages repository. See also p: labels.
    team-iosOwned by iOS platform team
    and removed
    in triagePresently being triaged by the triage team
    on Dec 9, 2024
  8. jmagman commented on Dec 9, 2024

    @jmagman
    Member
  9. LouiseHsu commented on Dec 9, 2024

    @LouiseHsu
    Contributor

    Thanks for filing an issue! Ill take a look - but yes, if you have reproducible code or can share your storekit configuration, that would be helpful!

  10. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    P2Important issues not at the top of the work list
    triaged-iosTriaged by iOS platform team
    on Dec 20, 2024
  11. richardhfj commented on Jan 9, 2025

    @richardhfj

    I also got this same issue.

    Whenever I am enabling Storekit 2 I also am getting the pigeon error. I also see this repeated in the logs: Device verification failed for transaction.
    InAppPurchaseStoreKitPlatform.enableStoreKit2();
    InAppPurchaseStoreKitPlatform.registerPlatform();

    As soon as I remove these problems disappear and the transactions are back to normal. Should I go back to regular in_app_purchase instead? Please confirm when you get the chance, thank you.

    Code in reference:
    void main() {
    InAppPurchaseStoreKitPlatform.enableStoreKit2();
    WidgetsFlutterBinding.ensureInitialized();
    // When using the Android plugin directly it is mandatory to register
    // the plugin as default instance as part of initializing the app.
    InAppPurchaseStoreKitPlatform.registerPlatform();

    runApp(_MyApp());
    }

  12. github-actions commented on Jan 27, 2025

    @github-actions

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
    If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
    Thanks for your contribution.

  13. github-actions commented on Feb 10, 2025

    @github-actions

    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.

  14. locked as resolved and limited conversation to collaborators on Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listp: in_app_purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.platform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamwaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions