Skip to content

Commit

Permalink
Merge branch 'release/1.2.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
vegaro committed Jul 1, 2020
2 parents da374da + 493c71e commit cad7af8
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 6 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 1.2.0

- Bumped iOS to 3.4.0 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases)
- Bumped Android to 3.2.0 [Changelog here](https://github.com/RevenueCat/purchases-android/releases)
- Upgrade Flutter Android APIs (https://github.com/RevenueCat/purchases-flutter/pull/74)
- Adds userDefaultsSuiteName as an option when setting up the SDK (https://github.com/RevenueCat/purchases-flutter/pull/70)
- Added managementURL to PurchaserInfo (https://github.com/RevenueCat/purchases-flutter/pull/67)
- Added originalPurchaseDate to PurchaserInfo (https://github.com/RevenueCat/purchases-flutter/pull/66)
- Added `setProxyURL` (https://github.com/RevenueCat/purchases-flutter/pull/63)
- Exposes `setFinishTransactions` (https://github.com/RevenueCat/purchases-flutter/pull/45)
- Adds missing error codes (https://github.com/RevenueCat/purchases-flutter/pull/64)
- Adds new headers for platformFlavor and platformFlavorVersion (https://github.com/RevenueCat/purchases-flutter/pull/57, https://github.com/RevenueCat/purchases-flutter/pull/46)

## 1.1.1

- Update README.md to remove macOS support (#52)
Expand Down
1 change: 1 addition & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
| Version | iOS version | Android version | Common files version |
|---------|-------------|-----------------|----------------------|
| 1.2.0 | 3.4.0 | 3.2.0 | 1.2.0 |
| 1.1.1 | 3.2.2 | 3.1.0 | 1.0.11 |
| 1.1.0 | 3.2.2 | 3.1.0 | 1.0.11 |
| 1.0.5 | 3.0.1 | 3.0.4 | 1.0.6 |
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.revenuecat.purchases_flutter'
version '1.1.1'
version '1.2.0'

buildscript {
ext.kotlin_version = '1.3.72'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public class PurchasesFlutterPlugin implements FlutterPlugin, MethodCallHandler,
private Activity activity;

private static final String PLATFORM_NAME = "flutter";
private static final String PLUGIN_VERSION = "1.2.0-SNAPSHOT";
private static final String PLUGIN_VERSION = "1.2.0";

/**
* Plugin registration.
Expand Down
2 changes: 1 addition & 1 deletion ios/Classes/PurchasesFlutterPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ - (NSString *)platformFlavor {
}

- (NSString *)platformFlavorVersion {
return @"1.2.0-SNAPSHOT";
return @"1.2.0";
}

@end
2 changes: 1 addition & 1 deletion ios/purchases_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
Pod::Spec.new do |s|
s.name = 'purchases_flutter'
s.version = '1.1.1'
s.version = '1.2.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!
Expand Down
31 changes: 30 additions & 1 deletion lib/errors.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,37 @@ enum PurchasesErrorCode {
invalidSubscriberAttributesError
}

/// Helper to convert from PlatformExceptions to PurchasesErrorCodes
class PurchasesErrorHelper {

/// Use this to convert a PlatformException to a PurchasesErrorCode.
/// It will return `PurchasesErrorCode.unknownError` if the error code is not
/// in the range of PurchasesErrorCodes.
///
/// ```
/// try {
/// PurchaserInfo purchaserInfo = await Purchases.purchasePackage(package);
/// } on PlatformException catch (e) {
/// var errorCode = PurchasesErrorHelper.getErrorCode(e);
/// switch(errorCode) {
/// case PurchasesErrorCode.purchaseCancelledError:
/// print("User cancelled");
/// break;
/// case PurchasesErrorCode.purchaseNotAllowedError:
/// print("User not allowed to purchase");
/// break;
/// default:
/// // Do other stuff
/// break;
/// }
/// }
/// ```
static PurchasesErrorCode getErrorCode(PlatformException e) {
return PurchasesErrorCode.values[int.parse(e.code)];
var errorCode = int.parse(e.code);
if (errorCode >= PurchasesErrorCode.values.length) {
return PurchasesErrorCode.unknownError;
}
return PurchasesErrorCode.values[errorCode];
}

}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: purchases_flutter
description: A Flutter plugin that makes implementing in-app subscriptions for iOS and Android simple – receipt validation and status tracking included!
version: 1.1.1
version: 1.2.0
homepage: https://www.revenuecat.com/
repository: https://github.com/RevenueCat/purchases-flutter
issue_tracker: https://github.com/RevenueCat/purchases-flutter/issues
Expand Down

0 comments on commit cad7af8

Please sign in to comment.