Skip to content

Commit 1b7afc5

Browse files
authored
[in_app_purchase] Added serviceTimeout code (flutter#3287)
1 parent d0fd4b1 commit 1b7afc5

File tree

5 files changed

+29
-1
lines changed

5 files changed

+29
-1
lines changed

packages/in_app_purchase/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.3.5
2+
3+
* [Android] Fixed: added support for the SERVICE_TIMEOUT (-3) response code.
4+
15
## 0.3.4+18
26

37
* Fix outdated links across a number of markdown files ([#3276](https://github.com/flutter/plugins/pull/3276))

packages/in_app_purchase/lib/src/billing_client_wrappers/billing_client_wrapper.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,11 @@ enum BillingResponse {
314314
// WARNING: Changes to this class need to be reflected in our generated code.
315315
// Run `flutter packages pub run build_runner watch` to rebuild and watch for
316316
// further changes.
317+
318+
/// The request has reached the maximum timeout before Google Play responds.
319+
@JsonValue(-3)
320+
serviceTimeout,
321+
317322
/// The requested feature is not supported by Play Store on the current device.
318323
@JsonValue(-2)
319324
featureNotSupported,

packages/in_app_purchase/lib/src/billing_client_wrappers/enum_converters.g.dart

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/in_app_purchase/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: in_app_purchase
22
description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play.
33
homepage: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase
4-
version: 0.3.4+18
4+
version: 0.3.5
55

66
dependencies:
77
async: ^2.0.8

packages/in_app_purchase/test/billing_client_wrappers/billing_client_wrapper_test.dart

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@ void main() {
3939
});
4040
});
4141

42+
// Make sure that the enum values are supported and that the converter call
43+
// does not fail
44+
test('response states', () async {
45+
BillingResponseConverter converter = BillingResponseConverter();
46+
converter.fromJson(-3);
47+
converter.fromJson(-2);
48+
converter.fromJson(-1);
49+
converter.fromJson(0);
50+
converter.fromJson(1);
51+
converter.fromJson(2);
52+
converter.fromJson(3);
53+
converter.fromJson(4);
54+
converter.fromJson(5);
55+
converter.fromJson(6);
56+
converter.fromJson(7);
57+
converter.fromJson(8);
58+
});
59+
4260
group('startConnection', () {
4361
final String methodName =
4462
'BillingClient#startConnection(BillingClientStateListener)';

0 commit comments

Comments
 (0)