Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release 1.3.0 #96

Merged
merged 27 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7ac4d4c
bumped purchases-hybrid-common to 1.3.1
aboedo Sep 11, 2020
b60bbb8
bumped common version to 1.4.0
aboedo Sep 18, 2020
4012aaf
added empty swift file so that swift code compiles correctly
aboedo Sep 18, 2020
bee1db6
ignored .last_build_id
aboedo Sep 18, 2020
ea83a47
updated deployment target version to 9.0.
aboedo Sep 18, 2020
6fb6d81
added new methods for attribution v2 to flutter plugin interface
aboedo Sep 18, 2020
577afa6
added new methods to the flutter dart interface
aboedo Sep 18, 2020
5fa3b1d
added deprecation warning in dart
aboedo Sep 18, 2020
1130ed1
fixeed param names typo for iOS, added new methods for Android
aboedo Sep 18, 2020
9ffd43f
updated purchases-hybrid-common version for Android
aboedo Sep 18, 2020
2f4d36c
bumped version number and added changelog
aboedo Sep 19, 2020
b233ff5
reverted accidental changes in podfile and main.dart
aboedo Sep 19, 2020
9e25469
removed deprecated call to addAttributionData in the example app
aboedo Sep 21, 2020
ebc1013
fix typo in purchases_flutter.dart
aboedo Sep 21, 2020
e6e2933
fixed typo in build.gradle, updated version of gradle build
aboedo Sep 21, 2020
cbe83f8
fixed missing semicolons
aboedo Sep 21, 2020
dae7745
updated calls to common code in PurchasesFlutterPlugin
aboedo Sep 21, 2020
3fc061e
updated version of purchases-hybrid-common
aboedo Sep 21, 2020
c3be6bb
updated podfile to use purchases-hybrid-common 1.4.1
aboedo Sep 21, 2020
9997355
fix typo in fbAnonymousID
aboedo Sep 21, 2020
ce01a05
fix docs from PR comments
aboedo Sep 21, 2020
6bc5c8c
added nonSubscriptionTransactions
aboedo Sep 21, 2020
1eff4a9
fixed mapping of transactions
aboedo Sep 22, 2020
3755ef9
updates to documentation for collectDeviceIdentifiers
aboedo Sep 22, 2020
8cd51fb
bumped purchases-hybrid-common to 1.4.2
aboedo Sep 22, 2020
3a2f786
fixes docs for non-subscription transactions
aboedo Sep 23, 2020
857bf0b
ran flutter format
aboedo Sep 23, 2020
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ pubspec.lock
example/ios/Flutter/flutter_export_environment.sh
example/.flutter-plugins-dependencies
example/ios/Flutter/Flutter.podspec
example/ios/Flutter/.last_build_id
example/android/.composite-enable
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
## 1.3.0

- Attribution V2:
- Deprecated `addAttribution` in favor of `setAdjustId`, `setAppsflyerId`, `setFBAnonymousId`, `setMparticleId`.
- Added support for OneSignal via `setOnesignalId`
- Added `setMediaSource`, `setCampaign`, `setAdGroup`, `setAd`, `setKeyword`, `setCreative`, and `collectDeviceIdentifiers`
https://github.com/RevenueCat/purchases-android/pull/184
- Bumped `purchases-hybrid-common` to 1.4.1 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases)
- Bumped `purchases-ios` to 3.7.1 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases)
- Bumped `purchases-android` to 3.5.0 [Changelog here](https://github.com/RevenueCat/purchases-android/releases)


## 1.2.1

- Fix a NullPointerException in the Android plugin (https://github.com/RevenueCat/purchases-flutter/pull/83)
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.3.0 | 3.7.1 | 3.5.0 | 1.4.1 |
| 1.2.1 | 3.4.0 | 3.2.0 | 1.2.0 |
| 1.2.0 | 3.4.0 | 3.2.0 | 1.2.0 |
| 1.1.1 | 3.2.2 | 3.1.0 | 1.0.11 |
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group 'com.revenuecat.purchases_flutter'
version '1.2.1'
version '1.3.0'

buildscript {
ext.kotlin_version = '1.3.72'
Expand Down Expand Up @@ -38,5 +38,5 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.revenuecat.purchases:purchases-hybrid-common:1.2.0"
implementation "com.revenuecat.purchases:purchases-hybrid-common:1.4.1"
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.revenuecat.purchases.PlatformInfo;
import com.revenuecat.purchases.PurchaserInfo;
import com.revenuecat.purchases.Purchases;
import com.revenuecat.purchases.PurchasesErrorCode;
import com.revenuecat.purchases.common.CommonKt;
import com.revenuecat.purchases.common.ErrorContainer;
import com.revenuecat.purchases.common.MappersKt;
import com.revenuecat.purchases.common.OnResult;
import com.revenuecat.purchases.common.OnResultList;
import com.revenuecat.purchases.common.SubscriberAttributesKt;
import com.revenuecat.purchases.common.mappers.PurchaserInfoMapperKt;
import com.revenuecat.purchases.interfaces.UpdatedPurchaserInfoListener;
import com.revenuecat.purchases.common.PlatformInfo;

import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -52,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 = "1.2.1";
private static final String PLUGIN_VERSION = "1.3.0";

/**
* Plugin registration.
Expand Down Expand Up @@ -234,6 +235,53 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) {
String pushToken = call.argument("pushToken");
setPushToken(pushToken, result);
break;
case "setAdjustID":
String adjustID = call.argument("adjustID");
setAdjustID(adjustID, result);
break;
case "setAppsflyerID":
String appsflyerID = call.argument("appsflyerID");
setAppsflyerID(appsflyerID, result);
break;
case "setFBAnonymousID":
String fbAnonymousID = call.argument("fbAnonymousID");
setFBAnonymousID(fbAnonymousID, result);
break;
case "setMparticleID":
String mparticleID = call.argument("mparticleID");
setMparticleID(mparticleID, result);
break;
case "setOnesignalID":
String onesignalID = call.argument("onesignalID");
setOnesignalID(onesignalID, result);
break;
case "setMediaSource":
String mediaSource = call.argument("mediaSource");
setMediaSource(mediaSource, result);
break;
case "setCampaign":
String campaign = call.argument("campaign");
setCampaign(campaign, result);
break;
case "setAdGroup":
String adGroup = call.argument("adGroup");
setAdGroup(adGroup, result);
break;
case "setAd":
String ad = call.argument("ad");
setAd(ad, result);
break;
case "setKeyword":
String keyword = call.argument("keyword");
setKeyword(keyword, result);
break;
case "setCreative":
String creative = call.argument("creative");
setCreative(creative, result);
break;
case "collectDeviceIdentifiers":
collectDeviceIdentifiers(result);
break;
default:
result.notImplemented();
break;
Expand All @@ -259,7 +307,7 @@ private void setupUpdatedPurchaserInfoListener() {
@Override
public void onReceived(@NonNull PurchaserInfo purchaserInfo) {
if (channel != null) {
channel.invokeMethod(PURCHASER_INFO_UPDATED, MappersKt.map(purchaserInfo));
channel.invokeMethod(PURCHASER_INFO_UPDATED, PurchaserInfoMapperKt.map(purchaserInfo));
}
}
});
Expand Down Expand Up @@ -291,7 +339,7 @@ private void setAllowSharingAppStoreAccount(@Nullable Boolean allowSharingAppSto

private void addAttributionData(Map<String, String> data, int network,
@Nullable String networkUserId, Result result) {
CommonKt.addAttributionData(data, network, networkUserId);
SubscriberAttributesKt.addAttributionData(data, network, networkUserId);
result.success(null);
}

Expand Down Expand Up @@ -399,27 +447,87 @@ private void invalidatePurchaserInfoCache(Result result) {
//================================================================================

private void setAttributes(Map<String, String> map, final Result result) {
CommonKt.setAttributes(map);
SubscriberAttributesKt.setAttributes(map);
result.success(null);
}

private void setEmail(String email, final Result result) {
CommonKt.setEmail(email);
SubscriberAttributesKt.setEmail(email);
result.success(null);
}

private void setPhoneNumber(String phoneNumber, final Result result) {
CommonKt.setPhoneNumber(phoneNumber);
SubscriberAttributesKt.setPhoneNumber(phoneNumber);
result.success(null);
}

private void setDisplayName(String displayName, final Result result) {
CommonKt.setDisplayName(displayName);
SubscriberAttributesKt.setDisplayName(displayName);
result.success(null);
}

private void setPushToken(String pushToken, final Result result) {
CommonKt.setPushToken(pushToken);
SubscriberAttributesKt.setPushToken(pushToken);
result.success(null);
}

private void setAdjustID(String adjustID, final Result result) {
SubscriberAttributesKt.setAdjustID(adjustID);
result.success(null);
}

private void setAppsflyerID(String appsflyerID, final Result result) {
SubscriberAttributesKt.setAppsflyerID(appsflyerID);
result.success(null);
}

private void setFBAnonymousID(String fbAnonymousID, final Result result) {
SubscriberAttributesKt.setFBAnonymousID(fbAnonymousID);
result.success(null);
}

private void setMparticleID(String mparticleID, final Result result) {
SubscriberAttributesKt.setMparticleID(mparticleID);
result.success(null);
}

private void setOnesignalID(String onesignalID, final Result result) {
SubscriberAttributesKt.setOnesignalID(onesignalID);
result.success(null);
}

private void setMediaSource(String mediaSource, final Result result) {
SubscriberAttributesKt.setMediaSource(mediaSource);
result.success(null);
}

private void setCampaign(String campaign, final Result result) {
SubscriberAttributesKt.setCampaign(campaign);
result.success(null);
}

private void setAdGroup(String adGroup, final Result result) {
SubscriberAttributesKt.setAdGroup(adGroup);
result.success(null);
}

private void setAd(String ad, final Result result) {
SubscriberAttributesKt.setAd(ad);
result.success(null);
}

private void setKeyword(String keyword, final Result result) {
SubscriberAttributesKt.setKeyword(keyword);
result.success(null);
}

private void setCreative(String creative, final Result result) {
SubscriberAttributesKt.setCreative(creative);
result.success(null);
}

private void collectDeviceIdentifiers(final Result result) {
SubscriberAttributesKt.collectDeviceIdentifiers();
result.success(null);
}

Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath 'com.android.tools.build:gradle:4.0.1'
}
}

Expand Down
2 changes: 1 addition & 1 deletion example/ios/Flutter/AppFrameworkInfo.plist
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>8.0</string>
<string>9.0</string>
</dict>
</plist>
74 changes: 14 additions & 60 deletions example/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,75 +10,29 @@ project 'Runner', {
'Release' => :release,
}

def parse_KV_file(file, separator='=')
file_abs_path = File.expand_path(file)
if !File.exists? file_abs_path
return [];
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_key_values = {}
skip_line_start_symbols = ["#", "/"]
File.foreach(file_abs_path) do |line|
next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ }
plugin = line.split(pattern=separator)
if plugin.length == 2
podname = plugin[0].strip()
path = plugin[1].strip()
podpath = File.expand_path("#{path}", file_abs_path)
generated_key_values[podname] = podpath
else
puts "Invalid plugin specification: #{line}"
end
end
generated_key_values
end

target 'Runner' do
# Flutter Pod

copied_flutter_dir = File.join(__dir__, 'Flutter')
copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework')
copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec')
unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path)
# Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet.
# That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration.
# CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist.

generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig')
unless File.exist?(generated_xcode_build_settings_path)
raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path)
cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR'];

unless File.exist?(copied_framework_path)
FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir)
end
unless File.exist?(copied_podspec_path)
FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir)
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

# Keep pod path relative so it can be checked into Podfile.lock.
pod 'Flutter', :path => 'Flutter'
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

# Plugin Pods
flutter_ios_podfile_setup

# Prepare symlinks folder. We use symlinks to avoid having Podfile.lock
# referring to absolute paths on developers' machines.
system('rm -rf .symlinks')
system('mkdir -p .symlinks/plugins')
plugin_pods = parse_KV_file('../.flutter-plugins')
plugin_pods.each do |name, path|
symlink = File.join('.symlinks', 'plugins', name)
File.symlink(path, symlink)
pod name, :path => File.join(symlink, 'ios')
end
target 'Runner' do
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['ENABLE_BITCODE'] = 'NO'
end
flutter_additional_ios_build_settings(target)
end
end
30 changes: 20 additions & 10 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,33 +1,43 @@
PODS:
- e2e (0.0.1):
- Flutter
- Flutter (1.0.0)
- Purchases (3.4.0)
- purchases_flutter (1.1.1):
- Purchases (3.7.1):
- PurchasesCoreSwift (= 3.7.1)
- purchases_flutter (1.3.0):
- Flutter
- PurchasesHybridCommon (= 1.2.0)
- PurchasesHybridCommon (1.2.0):
- Purchases (= 3.4.0)
- PurchasesHybridCommon (= 1.4.1)
- PurchasesCoreSwift (3.7.1)
- PurchasesHybridCommon (1.4.1):
- Purchases (= 3.7.1)

DEPENDENCIES:
- e2e (from `.symlinks/plugins/e2e/ios`)
- Flutter (from `Flutter`)
- purchases_flutter (from `.symlinks/plugins/purchases_flutter/ios`)

SPEC REPOS:
trunk:
- Purchases
- PurchasesCoreSwift
- PurchasesHybridCommon

EXTERNAL SOURCES:
e2e:
:path: ".symlinks/plugins/e2e/ios"
Flutter:
:path: Flutter
purchases_flutter:
:path: ".symlinks/plugins/purchases_flutter/ios"

SPEC CHECKSUMS:
e2e: 967b9b1fc533b7636a3b7a719f840c27f301fe1f
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
Purchases: b8cac232e403ca51541a425a65992b902cecc044
purchases_flutter: 9dbb0af4546265d4f6e7299d87026537d50dce4c
PurchasesHybridCommon: deba31751165f0a0f84eba3df68a54641f8a69b1
Purchases: 81efbd7dc9164247a0885ad12ddf6b043a58c1db
purchases_flutter: 896464400b779291abbe2a2bb650d7dad42741fa
PurchasesCoreSwift: eca892b2a0eff34d55d70e7c3349c1eb4c7659f5
PurchasesHybridCommon: e8d33a7dea50c157bd505aa7f8a4cc42520c1f8c

PODFILE CHECKSUM: 8685ee79ad9489b94b9f1ac3974f4638bb57b02e
PODFILE CHECKSUM: b1f7a399522c118a74b177b13c01eca692aa7e6d

COCOAPODS: 1.9.1
COCOAPODS: 1.9.3
Loading