Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
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
12 changes: 8 additions & 4 deletions packages/in_app_purchase/in_app_purchase/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
## NEXT

* Fixes integration tests.
* Updates example app Android compileSdkVersion to 31.
## 2.0.0

* **BREAKING CHANGES**:
* Adds a new `PurchaseStatus` named `canceled`. This means developers can distinguish between an error and user cancellation.
* Updates `restorePurchases` to emit an empty list of purchases on StoreKit when there are no purchases to restore (same as Android).
* Renames `in_app_purchase_ios` to `in_app_purchase_storekit`.
* Renames `InAppPurchaseIosPlatform` to `InAppPurchaseStoreKitPlatform`.
* Renames `InAppPurchaseIosPlatformAddition` to
`InAppPurchaseStoreKitPlatformAddition`.

* Deprecates the `InAppPurchaseAndroidPlatformAddition.enablePendingPurchases()` method and `InAppPurchaseAndroidPlatformAddition.enablePendingPurchase` property.
* Adds support for promotional offers on the store_kit_wrappers Dart API.
* Fixes integration tests.
* Updates example app Android compileSdkVersion to 31.

## 1.0.9

* Handle purchases with `PurchaseStatus.restored` correctly in the example App.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:io';

import 'package:flutter_test/flutter_test.dart';
import 'package:in_app_purchase/in_app_purchase.dart';
import 'package:in_app_purchase_android/in_app_purchase_android.dart';
import 'package:integration_test/integration_test.dart';

void main() {
IntegrationTestWidgetsFlutterBinding.ensureInitialized();

testWidgets('Can create InAppPurchase instance', (WidgetTester tester) async {
if (Platform.isAndroid) {
// https://github.com/flutter/flutter/issues/93837
InAppPurchaseAndroidPlatformAddition.enablePendingPurchases();
}
final InAppPurchase iapInstance = InAppPurchase.instance;
expect(iapInstance, isNotNull);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import 'dart:async';
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:in_app_purchase/in_app_purchase.dart';
import 'package:in_app_purchase_android/billing_client_wrappers.dart';
Expand All @@ -16,13 +15,6 @@ import 'consumable_store.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();

if (defaultTargetPlatform == TargetPlatform.android) {
// For play billing library 2.0 on Android, it is mandatory to call
// [enablePendingPurchases](https://developer.android.com/reference/com/android/billingclient/api/BillingClient.Builder.html#enablependingpurchases)
// as part of initializing the app.
InAppPurchaseAndroidPlatformAddition.enablePendingPurchases();
}

runApp(_MyApp());
}

Expand Down
10 changes: 3 additions & 7 deletions packages/in_app_purchase/in_app_purchase/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: in_app_purchase
description: A Flutter plugin for in-app purchases. Exposes APIs for making in-app purchases through the App Store and Google Play.
repository: https://github.com/flutter/plugins/tree/master/packages/in_app_purchase/in_app_purchase
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 1.0.9
# Temporarily disable publishing until in_app_purchase_storekit is published.
publish_to: none
version: 2.0.0

environment:
sdk: ">=2.12.0 <3.0.0"
Expand All @@ -22,10 +20,8 @@ dependencies:
flutter:
sdk: flutter
in_app_purchase_platform_interface: ^1.0.0
in_app_purchase_android: ^0.1.5
# Temporary path-based dependency to allow for renaming.
in_app_purchase_storekit:
path: ../in_app_purchase_storekit
in_app_purchase_android: ^0.2.1
in_app_purchase_storekit: ^0.2.0

dev_dependencies:
flutter_driver:
Expand Down