Skip to content

Commit

Permalink
[in_app_purchase] Update country code Android example (#6722)
Browse files Browse the repository at this point in the history
Updates the Android example app to use the replacement for the deprecated `getCountryCode`. Also udpates the deprecations method for `getCountryCode` to point to the correct variant of the platform interface method.

Follow-up to flutter/flutter#147230
  • Loading branch information
stuartmorgan committed May 13, 2024
1 parent f91f689 commit 1412041
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
4 changes: 4 additions & 0 deletions packages/in_app_purchase/in_app_purchase_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.5+1

* Updates example to use `countryCode` instead of deprecated `getCountryCode`.

## 0.3.5

* Replaces `getCountryCode` with `countryCode`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,7 @@ class _MyAppState extends State<_MyApp> {
foregroundColor: Colors.white,
),
onPressed: () {
final InAppPurchaseAndroidPlatformAddition addition =
InAppPurchasePlatformAddition.instance!
as InAppPurchaseAndroidPlatformAddition;
unawaited(deliverCountryCode(addition.getCountryCode()));
unawaited(deliverCountryCode(_inAppPurchasePlatform.countryCode()));
},
child: const Text('Fetch Country Code'),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class InAppPurchaseAndroidPlatformAddition
///
/// See: https://developer.android.com/reference/com/android/billingclient/api/BillingConfig
/// See: https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
@Deprecated('Use InAppPurchasePlatfrom.getCountryCode')
@Deprecated('Use InAppPurchasePlatfrom.countryCode')
Future<String> getCountryCode() async {
final BillingConfigWrapper billingConfig = await _billingClientManager
.runWithClient((BillingClient client) => client.getBillingConfig());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase_android
description: An implementation for the Android platform of the Flutter `in_app_purchase` plugin. This uses the Android BillingClient APIs.
repository: https://github.com/flutter/packages/tree/main/packages/in_app_purchase/in_app_purchase_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 0.3.5
version: 0.3.5+1

environment:
sdk: ^3.1.0
Expand Down

0 comments on commit 1412041

Please sign in to comment.