File tree Expand file tree Collapse file tree 4 files changed +33
-3
lines changed
packages/in_app_purchase/in_app_purchase_platform_interface Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1- ## NEXT
1+ ## 1.4.0
22
3+ * Adds ` getCountryCode ` API.
34* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1.
45
56## 1.3.7
3940
4041## 1.3.0
4142
42- * Added new ` PurchaseStatus ` named ` canceled ` to distinguish between an error and user cancellation.
43+ * Added new ` PurchaseStatus ` named ` canceled ` to distinguish between an error and user cancellation.
4344
4445## 1.2.0
4546
Original file line number Diff line number Diff line change @@ -194,4 +194,21 @@ abstract class InAppPurchasePlatform extends PlatformInterface {
194194 /// [PurchaseDetails.verificationData].
195195 Future <void > restorePurchases ({String ? applicationUserName}) =>
196196 throw UnimplementedError ('restorePurchases() has not been implemented.' );
197+
198+ /// Returns the user's country.
199+ ///
200+ /// Android:
201+ /// Returns Play billing country code based on ISO-3166-1 alpha2 format.
202+ ///
203+ /// See: https://developer.android.com/reference/com/android/billingclient/api/BillingConfig
204+ /// See: https://unicode.org/cldr/charts/latest/supplemental/territory_containment_un_m_49.html
205+ ///
206+ /// iOS:
207+ /// Returns the country code from SKStoreFrontWrapper.
208+ ///
209+ /// See: https://developer.apple.com/documentation/storekit/skstorefront?language=objc
210+ ///
211+ ///
212+ Future <String > countryCode () =>
213+ throw UnimplementedError ('countryCode() has not been implemented.' );
197214}
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/in_app_purcha
44issue_tracker : https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
55# NOTE: We strongly prefer non-breaking changes, even at the expense of a
66# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
7- version : 1.3.7
7+ version : 1.4.0
88
99environment :
1010 sdk : ^3.1.0
Original file line number Diff line number Diff line change @@ -119,6 +119,18 @@ void main() {
119119 throwsUnimplementedError,
120120 );
121121 });
122+
123+ test (
124+ 'Default implementation of countryCode should throw unimplemented error' ,
125+ () {
126+ final ExtendsInAppPurchasePlatform inAppPurchasePlatform =
127+ ExtendsInAppPurchasePlatform ();
128+
129+ expect (
130+ () => inAppPurchasePlatform.countryCode (),
131+ throwsUnimplementedError,
132+ );
133+ });
122134 });
123135
124136 group ('$InAppPurchasePlatformAddition ' , () {
You can’t perform that action at this time.
0 commit comments