Playstore Billing Country Android

📌 A Flutter plugin to get the user's billing country from Google Play Store.

Features

✅ Retrieves the billing country from Google Play Billing API (v6+).
✅ Works on Android devices with Google Play services.
✅ Uses Google Play BillingClient under the hood.

Installation

Add the package to your pubspec.yaml:

dependencies:
  playstore_billing_country_android: ^0.0.1

Usage

  1. Import the package:
import 'package:playstore_billing_country_android/playstore_billing_country_android.dart';
  1. Get the billing country

Call the getBillingCountry() method:

final PlaystoreBillingCountryAndroid billingPlugin = PlaystoreBillingCountryAndroid();

Future<void> fetchBillingCountry() async {
  try {
    final String? country = await billingPlugin.getBillingCountry();
    print('Billing Country: $country');
  } catch (e) {
    print('Error fetching billing country: $e');
  }
}

Platform Support

Platform Supported
✅ Android ✅ Yes
❌ iOS ❌ No

Requirements

  • Android API 21+
  • Google Play Billing API v6+
  • Google Play services installed

Troubleshooting

If the plugin returns null or fails:

  • Ensure the app is installed via Google Play (not sideloaded).
  • Verify Google Play Billing API is enabled for your Google Play account.
  • Debug logs can help: adb logcat -s BillingClient