From 982ba8e76f69a1aa37dcce3b25da3c803fa9572b Mon Sep 17 00:00:00 2001 From: aboedo Date: Mon, 15 Mar 2021 14:58:35 -0300 Subject: [PATCH] Release: 3.1.0 (#171) * slight updates to RELEASING.md * bumped to 3.1.0 and added changelog * bumped purchases-hybrid-common to 1.6.0 * updated VERSIONS file * wired in the simulatesAskToBuyInSandbox method for iOS * added no-op simulatesAskToBuyInSandbox in Android * updated copy for setSimulatesAskToBuyInSandbox and changelog * added "iOS only" to clarify usage of setSimulatesAskToBuyInSandbox * bumped common version to 1.6.1 * updated Podfile and added explicit handling of paymentPendingError * updated RELEASING.md, flutter format --- CHANGELOG-LATEST.md | 10 ++++--- CHANGELOG.md | 9 +++++++ RELEASING.md | 6 ++--- VERSIONS.md | 1 + android/build.gradle | 4 +-- .../PurchasesFlutterPlugin.java | 5 +++- example/ios/Podfile.lock | 26 +++++++++---------- example/ios/Runner.xcodeproj/project.pbxproj | 2 -- .../contents.xcworkspacedata | 2 +- example/lib/main.dart | 2 ++ ios/Classes/PurchasesFlutterPlugin.m | 11 +++++++- ios/purchases_flutter.podspec | 4 +-- lib/purchases_flutter.dart | 9 +++++++ macos/purchases_flutter.podspec | 4 +-- pubspec.yaml | 2 +- 15 files changed, 66 insertions(+), 31 deletions(-) diff --git a/CHANGELOG-LATEST.md b/CHANGELOG-LATEST.md index a3a362fbe..b409f2f69 100644 --- a/CHANGELOG-LATEST.md +++ b/CHANGELOG-LATEST.md @@ -1,4 +1,8 @@ -## 3.0.2 +## 3.1.0 -- Fixes versions number in plugin files - https://github.com/RevenueCat/purchases-flutter/pull/166 +- iOS: + - Added a new property `simulateAsksToBuyInSandbox`, that allows developers to test deferred purchases easily. +- Bumped purchases-hybrid-common to 1.6.1 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/1.6.1) +- Bumped purchases-ios to 3.10.6 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/3.10.6) +- Bumped purchases-android to 4.0.4 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/4.0.4) + https://github.com/RevenueCat/purchases-flutter/pull/171 diff --git a/CHANGELOG.md b/CHANGELOG.md index 79d9add23..796d1be60 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## 3.1.0 + +- iOS: + - Added a new method `setSimulatesAskToBuyInSandbox`, that allows developers to test deferred purchases easily. +- Bumped purchases-hybrid-common to 1.6.1 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/1.6.1) +- Bumped purchases-ios to 3.10.6 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/3.10.6) +- Bumped purchases-android to 4.0.4 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/4.0.4) + https://github.com/RevenueCat/purchases-flutter/pull/171 + ## 3.0.2 - Fixes versions number in plugin files diff --git a/RELEASING.md b/RELEASING.md index 7bf8c8633..9e5b2fddd 100644 --- a/RELEASING.md +++ b/RELEASING.md @@ -1,11 +1,11 @@ -1. Start a branch `bump/x.x.x` -1. Update to the latest SDK versions in purchases_flutter.podspec and build.gradle. +1. Start a branch `release/x.x.x` +1. Update to the latest SDK versions in ios/purchases_flutter.podspec, mac/purchases_flutter.podspec and build.gradle. 1. Run `flutter format .` 1. Update versions in VERSIONS.md. 1. Update CHANGELOG-LATEST.md with the changes for the current version (to be used by Fastlane for the github release notes) 1. Run `bundle exec fastlane bump_and_update_changelog version:X.Y.Z` (where X.Y.Z is the new version) to update the version number in pubspec.yaml, purchases_flutter.podspec and android/build.gradle. 1. `flutter pub pub publish --dry-run` -1. `git commit -am "Preparing for version x.y.z"` +1. Commit the changes, open a PR, merge when ready 1. `git tag x.y.z` 1. `git push origin master && git push --tags` 1. Create a new release in github and upload diff --git a/VERSIONS.md b/VERSIONS.md index 1b3006c8b..e2a5c20bf 100644 --- a/VERSIONS.md +++ b/VERSIONS.md @@ -1,5 +1,6 @@ | Version | iOS version | Android version | Common files version | |---------|-------------|-----------------|----------------------| +| 3.1.0 | 3.10.6 | 4.0.4 | 1.6.1 | | 3.0.2 | 3.9.2 | 4.0.1 | 1.5.0 | | 3.0.1 | 3.9.2 | 4.0.1 | 1.5.0 | | 3.0.0 | 3.9.2 | 4.0.1 | 1.5.0 | diff --git a/android/build.gradle b/android/build.gradle index d03f2936f..af568b25b 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ group 'com.revenuecat.purchases_flutter' -version '3.0.2' +version '3.1.0' buildscript { ext.kotlin_version = '1.3.72' @@ -38,5 +38,5 @@ android { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - implementation "com.revenuecat.purchases:purchases-hybrid-common:1.5.0" + implementation "com.revenuecat.purchases:purchases-hybrid-common:1.6.1" } diff --git a/android/src/main/java/com/revenuecat/purchases_flutter/PurchasesFlutterPlugin.java b/android/src/main/java/com/revenuecat/purchases_flutter/PurchasesFlutterPlugin.java index 17ae76a1c..57ae905b5 100644 --- a/android/src/main/java/com/revenuecat/purchases_flutter/PurchasesFlutterPlugin.java +++ b/android/src/main/java/com/revenuecat/purchases_flutter/PurchasesFlutterPlugin.java @@ -53,7 +53,7 @@ public class PurchasesFlutterPlugin implements FlutterPlugin, MethodCallHandler, @Nullable private Activity activity; private static final String PLATFORM_NAME = "flutter"; - private static final String PLUGIN_VERSION = "3.0.2"; + private static final String PLUGIN_VERSION = "3.1.0"; /** * Plugin registration. @@ -218,6 +218,9 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { case "presentCodeRedemptionSheet": // NOOP break; + case "setSimulatesAskToBuyInSandbox": + // NOOP + break; case "setAttributes": Map attributes = call.argument("attributes"); setAttributes(attributes, result); diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index 94afe4192..9fc72b3f9 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -2,14 +2,14 @@ PODS: - Flutter (1.0.0) - integration_test (0.0.1): - Flutter - - Purchases (3.9.2): - - PurchasesCoreSwift (= 3.9.2) - - purchases_flutter (2.0.3): + - Purchases (3.10.6): + - PurchasesCoreSwift (= 3.10.6) + - purchases_flutter (3.1.0): - Flutter - - PurchasesHybridCommon (= 1.5.0) - - PurchasesCoreSwift (3.9.2) - - PurchasesHybridCommon (1.5.0): - - Purchases (= 3.9.2) + - PurchasesHybridCommon (= 1.6.1) + - PurchasesCoreSwift (3.10.6) + - PurchasesHybridCommon (1.6.1): + - Purchases (= 3.10.6) DEPENDENCIES: - Flutter (from `Flutter`) @@ -31,13 +31,13 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/purchases_flutter/ios" SPEC CHECKSUMS: - Flutter: 0e3d915762c693b495b44d77113d4970485de6ec + Flutter: 434fef37c0980e73bb6479ef766c45957d4b510c integration_test: 5ed24a436eb7ec17b6a13046e9bf7ca4a404e59e - Purchases: d8a798c9c7552fe66b550bf314a143e94ffa70c8 - purchases_flutter: 27f87080055c0fd2cd124c247b10cae75b46e7e1 - PurchasesCoreSwift: ea4eabae180416e580ac60366f41aa1fefec0693 - PurchasesHybridCommon: d9bfb34309db4c9ba82a6f7f3a6275c13befdca7 + Purchases: 520fdb59140fed96932a30d02a3ec04858cb541c + purchases_flutter: 05472ba84c83f05a138a3a657f1013f5f7143539 + PurchasesCoreSwift: 31c2a3d7394432abbe64d46f0933835de0b33033 + PurchasesHybridCommon: 013c8072b73e752a206779747e88c068fbf999ec PODFILE CHECKSUM: a75497545d4391e2d394c3668e20cfb1c2bbd4aa -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.1 diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index c1208672a..b55443d26 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -244,7 +244,6 @@ ); inputPaths = ( "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../Flutter/Flutter.framework", "${BUILT_PRODUCTS_DIR}/Purchases/Purchases.framework", "${BUILT_PRODUCTS_DIR}/PurchasesCoreSwift/PurchasesCoreSwift.framework", "${BUILT_PRODUCTS_DIR}/PurchasesHybridCommon/PurchasesHybridCommon.framework", @@ -253,7 +252,6 @@ ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Flutter.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Purchases.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PurchasesCoreSwift.framework", "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PurchasesHybridCommon.framework", diff --git a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 1d526a16e..919434a62 100644 --- a/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/example/lib/main.dart b/example/lib/main.dart index 07ad2d001..774219084 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -144,6 +144,8 @@ class _PurchaseButton extends StatelessWidget { print("User cancelled"); } else if (errorCode == PurchasesErrorCode.purchaseNotAllowedError) { print("User not allowed to purchase"); + } else if (errorCode == PurchasesErrorCode.paymentPendingError) { + print("Payment is pending"); } } return InitialScreen(); diff --git a/ios/Classes/PurchasesFlutterPlugin.m b/ios/Classes/PurchasesFlutterPlugin.m index b5564066f..d8cf929e6 100644 --- a/ios/Classes/PurchasesFlutterPlugin.m +++ b/ios/Classes/PurchasesFlutterPlugin.m @@ -78,6 +78,8 @@ - (void)handleMethodCall:(FlutterMethodCall *)call [self createAlias:arguments[@"newAppUserID"] result:result]; } else if ([@"setDebugLogsEnabled" isEqualToString:call.method]) { [self setDebugLogsEnabled:[arguments[@"enabled"] boolValue] result:result]; + } else if ([@"setSimulatesAskToBuyInSandbox" isEqualToString:call.method]) { + [self setSimulatesAskToBuyInSandbox:[arguments[@"enabled"] boolValue] result:result]; } else if ([@"setProxyURLString" isEqualToString:call.method]) { [self setProxyURLString:arguments[@"proxyURLString"] result:result]; } else if ([@"getPurchaserInfo" isEqualToString:call.method]) { @@ -283,6 +285,13 @@ - (void)setProxyURLString:(nullable NSString *)proxyURLString result(nil); } +- (void)setSimulatesAskToBuyInSandbox:(BOOL)enabled + result:(FlutterResult)result +{ + [RCCommonFunctionality setSimulatesAskToBuyInSandbox:enabled]; + result(nil); +} + - (void)getPurchaserInfoWithResult:(FlutterResult)result { [RCCommonFunctionality getPurchaserInfoWithCompletionBlock:[self getResponseCompletionBlock:result]]; @@ -483,7 +492,7 @@ - (NSString *)platformFlavor { } - (NSString *)platformFlavorVersion { - return @"3.0.2"; + return @"3.1.0"; } @end diff --git a/ios/purchases_flutter.podspec b/ios/purchases_flutter.podspec index eb7ae0033..41703d9f9 100644 --- a/ios/purchases_flutter.podspec +++ b/ios/purchases_flutter.podspec @@ -3,7 +3,7 @@ # Pod::Spec.new do |s| s.name = 'purchases_flutter' - s.version = '3.0.2' + s.version = '3.1.0' s.summary = 'Cross-platform subscriptions framework for Flutter.' s.description = <<-DESC Client for the RevenueCat subscription and purchase tracking system, making implementing in-app subscriptions in Flutter easy - receipt validation and status tracking included! @@ -15,7 +15,7 @@ Pod::Spec.new do |s| s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'Flutter' - s.dependency 'PurchasesHybridCommon', '1.5.0' + s.dependency 'PurchasesHybridCommon', '1.6.1' s.ios.deployment_target = '9.0' s.swift_version = '5.0' diff --git a/lib/purchases_flutter.dart b/lib/purchases_flutter.dart index 3ce02da2d..758b1636a 100644 --- a/lib/purchases_flutter.dart +++ b/lib/purchases_flutter.dart @@ -289,6 +289,15 @@ class Purchases { .invokeMethod('setDebugLogsEnabled', {'enabled': enabled}); } + /// + /// iOS only. Set this property to true *only* when testing the ask-to-buy / SCA purchases flow. + /// More information: http://errors.rev.cat/ask-to-buy + /// + static Future setSimulatesAskToBuyInSandbox(bool enabled) async { + return await _channel + .invokeMethod('setSimulatesAskToBuyInSandbox', {'enabled': enabled}); + } + /// /// Set this property to your proxy URL before configuring Purchases *only* if you've received a proxy key value from your RevenueCat contact. /// diff --git a/macos/purchases_flutter.podspec b/macos/purchases_flutter.podspec index b78de83d4..b51b1a6ff 100644 --- a/macos/purchases_flutter.podspec +++ b/macos/purchases_flutter.podspec @@ -4,7 +4,7 @@ # Pod::Spec.new do |s| s.name = 'purchases_flutter' - s.version = '3.0.2' + s.version = '3.1.0' s.summary = 'Cross-platform subscriptions framework for Flutter.' s.description = <<-DESC Client for the RevenueCat subscription and purchase tracking system, making implementing in-app subscriptions in Flutter easy - receipt validation and status tracking included! @@ -16,7 +16,7 @@ Pod::Spec.new do |s| s.source_files = 'Classes/**/*' s.public_header_files = 'Classes/**/*.h' s.dependency 'FlutterMacOS' - s.dependency 'PurchasesHybridCommon', '1.5.0' + s.dependency 'PurchasesHybridCommon', '1.6.1' s.platform = :osx, '10.12' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } s.swift_version = '5.0' diff --git a/pubspec.yaml b/pubspec.yaml index f8a8bcc37..cfe6effe6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: purchases_flutter description: A Flutter plugin that makes it simple to build in-app purchases and subscriptions – receipt validation, status tracking, and more. Supports iOS and Android. -version: 3.0.2 +version: 3.1.0 homepage: https://www.revenuecat.com/ repository: https://github.com/RevenueCat/purchases-flutter issue_tracker: https://github.com/RevenueCat/purchases-flutter/issues