Skip to content

Commit

Permalink
Prep for 3.9.4 release (RevenueCat#326)
Browse files Browse the repository at this point in the history
  • Loading branch information
beylmk authored Feb 18, 2022
1 parent 03f4e18 commit 736404d
Show file tree
Hide file tree
Showing 17 changed files with 84 additions and 63 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ jobs:
ios-integration-test:
description: "Run integration tests for Flutter"
macos:
xcode: 12.2.0
xcode: 12.3.0
steps:
- checkout
- run:
name: Open simulator
command: xcrun instruments -w "iPhone 11 Pro (14.2) [" || true
command: xcrun instruments -w "iPhone 11 Pro (14.3) [" || true
- setup-flutter
- restore_cache:
name: Restore cocoapods specs and pods
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG-LATEST.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 3.9.3
## 3.9.4

- Fix missing IntroductoryPrice export (https://github.com/RevenueCat/purchases-flutter/pull/310)
- Add back IntroductoryPrice fields that were accidentally removed without a major release (https://github.com/RevenueCat/purchases-flutter/pull/319)
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 3.9.4

- Add back IntroductoryPrice fields that were accidentally removed without a major release (https://github.com/RevenueCat/purchases-flutter/pull/319)

## 3.9.3

- Fix missing IntroductoryPrice export (https://github.com/RevenueCat/purchases-flutter/pull/310)
Expand Down
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.551.0)
aws-sdk-core (3.125.5)
aws-partitions (1.554.0)
aws-sdk-core (3.126.1)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.53.0)
aws-sdk-core (~> 3, >= 3.125.0)
aws-sdk-kms (1.54.0)
aws-sdk-core (~> 3, >= 3.126.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.111.3)
aws-sdk-core (~> 3, >= 3.125.0)
aws-sdk-s3 (1.112.0)
aws-sdk-core (~> 3, >= 3.126.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.4.0)
Expand All @@ -36,7 +36,7 @@ GEM
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
emoji_regex (3.2.3)
excon (0.90.0)
excon (0.91.0)
faraday (1.9.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand Down Expand Up @@ -66,7 +66,7 @@ GEM
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.6)
fastlane (2.203.0)
fastlane (2.204.3)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand Down Expand Up @@ -106,7 +106,7 @@ GEM
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.15.0)
google-apis-androidpublisher_v3 (0.16.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.2)
addressable (~> 2.5, >= 2.5.1)
Expand All @@ -129,15 +129,15 @@ GEM
google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.2.0)
google-cloud-storage (1.36.0)
google-cloud-storage (1.36.1)
addressable (~> 2.8)
digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.1)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.1.0)
googleauth (1.1.1)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
Expand All @@ -148,7 +148,7 @@ GEM
http-cookie (1.0.4)
domain_name (~> 0.5)
httpclient (2.8.3)
jmespath (1.5.0)
jmespath (1.6.0)
json (2.6.1)
jwt (2.3.0)
memoist (0.16.2)
Expand Down
2 changes: 2 additions & 0 deletions VERSIONS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
| Version | iOS version | Android version | Common files version |
|---------|-------------|-----------------|----------------------|
| 3.9.4 | 3.13.2 | 4.6.1 | 1.11.2 |
| 3.9.3 | 3.13.2 | 4.6.1 | 1.11.2 |
| 3.9.2 | 3.13.2 | 4.6.1 | 1.11.2 |
| 3.9.1 | 3.13.2 | 4.6.1 | 1.11.2 |
| 3.9.0 | 3.13.1 | 4.6.0 | 1.11.1 |
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 '3.9.3'
version '3.9.4'

buildscript {
ext.kotlin_version = '1.3.72'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,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.9.3";
private static final String PLUGIN_VERSION = "3.9.4";

/**
* 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 @@ -507,7 +507,7 @@ - (NSString *)platformFlavor {
}

- (NSString *)platformFlavorVersion {
return @"3.9.3";
return @"3.9.4";
}

@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 = '3.9.3'
s.version = '3.9.4'
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
38 changes: 24 additions & 14 deletions lib/models/introductory_price.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'introductory_price.freezed.dart';
part 'introductory_price.g.dart';

enum PeriodUnit {
day,
week,
month,
year,
unknown
}
enum PeriodUnit { day, week, month, year, unknown }

@freezed

Expand All @@ -36,7 +30,8 @@ class IntroductoryPrice with _$IntroductoryPrice {
/// String representation of unit for the billing period of the introductory
/// price, can be DAY, WEEK, MONTH or YEAR.
@Deprecated('Use periodUnit property of type PeriodUnit instead.')
@JsonKey(name: 'periodUnit') String introPricePeriodUnit,
@JsonKey(name: 'periodUnit')
String introPricePeriodUnit,

/// Number of units for the billing period of the introductory price.
@JsonKey(name: 'periodNumberOfUnits') int periodNumberOfUnits,
Expand All @@ -47,11 +42,26 @@ class IntroductoryPrice with _$IntroductoryPrice {
PeriodUnit get periodUnit {
// ignore: deprecated_member_use_from_same_package
switch (introPricePeriodUnit) {
case 'DAY': { return PeriodUnit.day; }
case 'WEEK': { return PeriodUnit.week; }
case 'MONTH': { return PeriodUnit.month; }
case 'YEAR': { return PeriodUnit.year; }
default: { return PeriodUnit.unknown; }
case 'DAY':
{
return PeriodUnit.day;
}
case 'WEEK':
{
return PeriodUnit.week;
}
case 'MONTH':
{
return PeriodUnit.month;
}
case 'YEAR':
{
return PeriodUnit.year;
}
default:
{
return PeriodUnit.unknown;
}
}
}

Expand Down Expand Up @@ -80,4 +90,4 @@ class IntroductoryPrice with _$IntroductoryPrice {

factory IntroductoryPrice.fromJson(Map<String, dynamic> json) =>
_$IntroductoryPriceFromJson(json);
}
}
2 changes: 1 addition & 1 deletion macos/purchases_flutter.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'purchases_flutter'
s.version = '3.9.3'
s.version = '3.9.4'
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
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: purchases_flutter
description: A Flutter plugin that makes it simple to add and manage in-app
purchases (IAP) and subscriptions. Supports Android, iOS, macOS, iPadOS, and
watchOS.
version: 3.9.3
version: 3.9.4
homepage: https://www.revenuecat.com/
repository: https://github.com/RevenueCat/purchases-flutter
issue_tracker: https://github.com/RevenueCat/purchases-flutter/issues
Expand Down
4 changes: 2 additions & 2 deletions revenuecat_examples/MagicWeather/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (keystorePropertiesFile.exists()) {
}

android {
compileSdkVersion 29
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -46,7 +46,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.revenuecat.purchases_sample"
minSdkVersion 16
targetSdkVersion 29
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Expand Down
4 changes: 2 additions & 2 deletions revenuecat_examples/MagicWeather/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PODS:
- Flutter (1.0.0)
- Purchases (3.13.2):
- PurchasesCoreSwift (= 3.13.2)
- purchases_flutter (3.9.1):
- purchases_flutter (3.9.4):
- Flutter
- PurchasesHybridCommon (= 1.11.2)
- PurchasesCoreSwift (3.13.2)
Expand All @@ -28,7 +28,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
Purchases: 03200de9288724e77de435000d1828601e6b8e00
purchases_flutter: 513e990912ff636879bc414dc01071bf21c01eca
purchases_flutter: 3b13af6f0fbb20ebc62d5e41943aa1a17ec723ab
PurchasesCoreSwift: 2ea4b33e5cece5c8a0751594ef7c6cbfcbd747a9
PurchasesHybridCommon: 56ef42d85c3e930d49aff4ac5fa027373d2e1bb8

Expand Down
4 changes: 2 additions & 2 deletions revenuecat_examples/purchase_tester/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28
compileSdkVersion 31

lintOptions {
disable 'InvalidPackage'
Expand All @@ -34,7 +34,7 @@ android {
defaultConfig {
applicationId "com.revenuecat.purchases_sample"
minSdkVersion 16
targetSdkVersion 28
targetSdkVersion 31
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
19 changes: 8 additions & 11 deletions revenuecat_examples/purchase_tester/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,14 @@ class _UpsellScreenState extends State<UpsellScreen> {
// ignore: deprecated_member_use
final int introPriceCycles = introPrice.introPriceCycles;


print(
'introPricePeriodUnit: $introPricePeriodUnit, periodUnit: '
'$periodUnit, price: $price.toString(), priceString: '
'$priceString, cycles: $cycles.toString(), periodNumberOfUnits: '
'$periodNumberOfUnits, introPrice: $introPrice.toString(), '
'introPriceString: $introPriceString, introPricePeriod: '
'$introPricePeriod, introPricePeriodNumberOfUnits: '
'$introPricePeriodNumberOfUnits, introPriceCycles: '
'$introPriceCycles, introPricePrice: $introPricePrice.toString()');

print('introPricePeriodUnit: $introPricePeriodUnit, periodUnit: '
'$periodUnit, price: $price.toString(), priceString: '
'$priceString, cycles: $cycles.toString(), periodNumberOfUnits: '
'$periodNumberOfUnits, introPrice: $introPrice.toString(), '
'introPriceString: $introPriceString, introPricePeriod: '
'$introPricePeriod, introPricePeriodNumberOfUnits: '
'$introPricePeriodNumberOfUnits, introPriceCycles: '
'$introPriceCycles, introPricePrice: $introPricePrice.toString()');
}
}

Expand Down
28 changes: 18 additions & 10 deletions test/purchases_flutter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,10 @@ void main() {
}
});

test('IntroductoryPrice has both PeriodUnit enum and periodUnit string', () async {
test('IntroductoryPrice has both PeriodUnit enum and periodUnit string',
() async {
final mockIntroductoryPrice = IntroductoryPrice.fromJson(
mockIntroductoryPriceJson,
mockIntroductoryPriceJson,
);
expect(mockIntroductoryPrice.periodUnit, PeriodUnit.day);
expect(mockIntroductoryPrice.introPricePeriodUnit, 'DAY');
Expand All @@ -478,30 +479,37 @@ void main() {
expect(mockIntroPrice.price, mockIntroPrice.introPrice);
expect(mockIntroPrice.priceString, mockIntroPrice.introPriceString);
expect(mockIntroPrice.period, mockIntroPrice.introPricePeriod);
expect(mockIntroPrice.periodNumberOfUnits,
mockIntroPrice.introPricePeriodNumberOfUnits,);
expect(
mockIntroPrice.periodNumberOfUnits,
mockIntroPrice.introPricePeriodNumberOfUnits,
);
expect(mockIntroPrice.cycles, mockIntroPrice.introPriceCycles);
});

test('IntroductoryPrice PeriodUnit maps correctly', () async {
/// test day
const introPricePeriodUnitDay = IntroductoryPrice(0.0, '\$0.00', 'P2W', 1, 'DAY', 14);
const introPricePeriodUnitDay =
IntroductoryPrice(0.0, '\$0.00', 'P2W', 1, 'DAY', 14);
expect(introPricePeriodUnitDay.periodUnit, PeriodUnit.day);

/// test week
const introPricePeriodUnitWeek = IntroductoryPrice(0.0, '\$0.00', 'P2W', 1, 'WEEK', 14);
const introPricePeriodUnitWeek =
IntroductoryPrice(0.0, '\$0.00', 'P2W', 1, 'WEEK', 14);
expect(introPricePeriodUnitWeek.periodUnit, PeriodUnit.week);

/// test month
const introPricePeriodUnitMonth = IntroductoryPrice(0.0, '\$0.00', 'P2W', 1, 'MONTH', 14);
const introPricePeriodUnitMonth =
IntroductoryPrice(0.0, '\$0.00', 'P2W', 1, 'MONTH', 14);
expect(introPricePeriodUnitMonth.periodUnit, PeriodUnit.month);

/// test year
const introPricePeriodUnitYear = IntroductoryPrice(0.0, '\$0.00', 'P2W', 1, 'YEAR', 14);
const introPricePeriodUnitYear =
IntroductoryPrice(0.0, '\$0.00', 'P2W', 1, 'YEAR', 14);
expect(introPricePeriodUnitYear.periodUnit, PeriodUnit.year);

/// test unknown
const introPricePeriodUnitUnknown = IntroductoryPrice(0.0, '\$0.00', 'P2W', 1, 'sadf', 14);
const introPricePeriodUnitUnknown =
IntroductoryPrice(0.0, '\$0.00', 'P2W', 1, 'sadf', 14);
expect(introPricePeriodUnitUnknown.periodUnit, PeriodUnit.unknown);
});
});
}

0 comments on commit 736404d

Please sign in to comment.