Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[in_app_purchase] Update country code Android example
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-g committed May 13, 2024
commit d58810ead6bbf39ae9ad4daa35a4c4df6c981ff0
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