Skip to content

[in_app_purchase] PigeonError after enabling StoreKit2 #159843

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

Closed
Tracked by #157558
bahadirarslan opened this issue Dec 5, 2024 · 8 comments
Closed
Tracked by #157558

[in_app_purchase] PigeonError after enabling StoreKit2 #159843

bahadirarslan opened this issue Dec 5, 2024 · 8 comments
Labels
p: in_app_purchase Plugin for in-app purchase P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@bahadirarslan
Copy link

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!
@bahadirarslan bahadirarslan changed the title [in_app_purchase] PigenError after enabling StoreKit2 [in_app_purchase] PigeonError after enabling StoreKit2 Dec 5, 2024
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Dec 6, 2024
@darshankawar
Copy link
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.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 6, 2024
@bahadirarslan
Copy link
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?

@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 Dec 8, 2024
@darshankawar
Copy link
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.

@darshankawar darshankawar added platform-ios iOS applications specifically p: in_app_purchase Plugin for in-app purchase package flutter/packages repository. See also p: labels. team-ios Owned by iOS platform team and removed in triage Presently being triaged by the triage team labels Dec 9, 2024
@jmagman
Copy link
Member

jmagman commented Dec 9, 2024

cc @LouiseHsu

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

@jmagman jmagman added waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds P2 Important issues not at the top of the work list triaged-ios Triaged by iOS platform team labels Dec 20, 2024
@richardhfj
Copy link

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());
}

Copy link

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.

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 Feb 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p: in_app_purchase Plugin for in-app purchase P2 Important issues not at the top of the work list package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Projects
None yet
Development

No branches or pull requests

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy