TrungNguyen
TrungNguyen

Reputation: 11

Flutter - in-app-purchase - load product from store response raw price 0 on some Android devices

Flutter - in-app-purchase - load products from store response raw price 0 on some Android devices. I try to load products from store:

final available = await iapConnection.isAvailable();
    if (!available) {
      logError('Store Not Available!');
      return;
    }
final response = await iapConnection.queryProductDetails(ids);
logInfo('Store IAP products: ${response.productDetails}');

however, the product details response rawPrice = 0 on some Android devices only, this code work well on iOS.

flutter 3.16.4 - in_app_purchase: ^3.1.12.

flutter doctor:

Flutter (Channel stable, 3.16.4, on macOS 14.1 23B74 darwin-arm64, locale en-VN) • Flutter version 3.16.4 on channel stable at /Users/mac/Documents/flutter/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 2e9cb0a (3 months ago), 2023-12-11 14:35:13 -0700 • Engine revision 54a7145303 • Dart version 3.2.3 • DevTools version 2.28.4 Android toolchain - develop for Android devices (Android SDK version 34.0.0) Android SDK at /Users/mac/Library/Android/sdk Platform android-34, build-tools 34.0.0 Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) All Android licenses accepted.

Xcode - develop for iOS and macOS (Xcode 15.0.1) Xcode at /Applications/Xcode.app/Contents/Developer Build 15A507 CocoaPods version 1.14.3

Chrome - develop for the web Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

Android Studio (version 2023.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 17.0.7+0-17.0.7b1000.6-10550314)

VS Code (version 1.87.2) VS Code at /Applications/Visual Studio Code.app/Contents Flutter extension version 3.84.0

Connected device (6 available) sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 12 (API 31) (emulator) sdk gphone64 arm64 (mobile) • emulator-5556 • android-arm64 • Android 14 (API 34) (emulator) iPhone SE (3rd generation) (mobile) • C9DA653C-E464-4EDE-906F-0F999E27DB3C • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator) iPhone 15 (mobile) • 6F1C1C26-D800-4BB4-B0E8-0D10FD5692E0 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-0 (simulator) macOS (desktop) • macos • darwin-arm64 • macOS 14.1 23B74 darwin-arm64 Chrome (web) • chrome • web-javascript • Google Chrome 123.0.6312.58

Network resources All expected network resources are available.

No issues found! exit code 0

Please help me figure out what are the problems here: play store return wrong response, configuration of in-app purchase, flutter in_app_purchase error or my code?

Thank you.

Upvotes: 0

Views: 77

Answers (0)

Related Questions