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

Version 3.4.0. Attribution v2 and nonSubscriptionTransactions #174

Merged
merged 22 commits into from
Sep 23, 2020
Merged
Show file tree
Hide file tree
Changes from 20 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
28 changes: 14 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ commands:
find . -type f -name 'yarn.lock' -not -path "*node_modules*" -exec cat
{} + >> ~/.tmp/checksumfiles/yarn.lock
name: Create cache checksum file
- restore_cache:
keys:
- >-
yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json"
}}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{
.Environment.CACHE_VERSION }}
# - restore_cache:
# keys:
# - >-
# yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json"
# }}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{
# .Environment.CACHE_VERSION }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This step is failing, still don't know why. I have tried by using /tmp/yarn and ./tmp/yarn with the same results.

The orb has an open issue about it, so I will monitor and see if they fix it react-native-community/react-native-circleci-orb#66, until the, I think we can live without the caches

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add a comment and a link to react-native-community/react-native-circleci-orb#66 to the code here, so that when we look back at it we understand why it's commented and we check if it has been fixed

- run:
command: >-
yarn example && yarn install --frozen-lockfile --non-interactive --cache-folder ./tmp/yarn
yarn example && yarn install --frozen-lockfile --non-interactive --cache-folder /tmp/yarn
name: Yarn Install
- save_cache:
key: >
yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json"
}}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{
.Environment.CACHE_VERSION }}
paths:
- ./tmp/yarn
# - save_cache:
# key: >
# yarn-cache-{{ arch }}-{{ checksum "~/.tmp/checksumfiles/package.json"
# }}-{{ checksum "~/.tmp/checksumfiles/yarn.lock" }}-{{
# .Environment.CACHE_VERSION }}
# paths:
# - /tmp/yarn

install_pods:
steps:
Expand Down
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
## 3.4.0

- Removes usage of BuildConfig [#171](https://github.com/RevenueCat/react-native-purchases/pull/171)
- Bumped common files to 1.4.1 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/tag/1.4.1)
- Bumped iOS to 3.7.1 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/tag/3.7.1)
- Bumped Android to 3.5.0 [Changelog here](https://github.com/RevenueCat/purchases-android/releases/tag/3.5.0)
- Added a new property `nonSubscriptionTransactions` in `PurchaserInfo` to better manage non-subscriptions
- 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

## 3.3.3

- Removes usage of BuildConfig [#171](https://github.com/RevenueCat/react-native-purchases/pull/171)
- Bumped common files to 1.3.1 [Changelog here](https://github.com/RevenueCat/purchases-hybrid-common/releases/tag/1.3.1)
- Bumped iOS to 3.5.1 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/tag/3.5.1)-
- Bumped Android to 3.3.0 [Changelog here](https://github.com/RevenueCat/purchases-android/releases/tag/3.3.0)-
- Bumped iOS to 3.5.1 [Changelog here](https://github.com/RevenueCat/purchases-ios/releases/tag/3.5.1)
- Bumped Android to 3.3.0 [Changelog here](https://github.com/RevenueCat/purchases-android/releases/tag/3.3.0)

## 3.3.2

Expand Down
2 changes: 1 addition & 1 deletion RNPurchases.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ Pod::Spec.new do |spec|
spec.exclude_files = "ios/Purchases.framework"

spec.dependency "React"
spec.dependency "PurchasesHybridCommon", "1.3.1"
spec.dependency "PurchasesHybridCommon", "1.4.1"
end
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 |
|---------|-------------|-----------------|----------------------|
| 3.4.0 | 3.7.1 | 3.5.0 | 1.4.1 |
| 3.3.3 | 3.5.1 | 3.3.0 | 1.3.1 |
| 3.3.2 | 3.4.0 | 3.2.0 | 1.2.0 |
| 3.3.1 | 3.4.0 | 3.2.0 | 1.2.0 |
Expand Down
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ android {
minSdkVersion 16
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
versionCode 1
versionName '3.3.3'
versionName '3.4.0'
}

buildTypes {
Expand Down Expand Up @@ -123,6 +123,6 @@ def kotlin_version = getExtOrDefault('kotlinVersion')
dependencies {
//noinspection GradleDynamicVersion
api 'com.facebook.react:react-native:+'
implementation 'com.revenuecat.purchases:purchases-hybrid-common:1.3.1'
implementation 'com.revenuecat.purchases:purchases-hybrid-common:1.4.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,15 @@
import com.facebook.react.bridge.ReadableMap;
import com.facebook.react.bridge.WritableArray;
import com.facebook.react.modules.core.DeviceEventManagerModule;
import com.revenuecat.purchases.PlatformInfo;
import com.revenuecat.purchases.PurchaserInfo;
import com.revenuecat.purchases.Purchases;
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.PlatformInfo;
import com.revenuecat.purchases.common.SubscriberAttributesKt;
import com.revenuecat.purchases.common.mappers.PurchaserInfoMapperKt;
import com.revenuecat.purchases.interfaces.UpdatedPurchaserInfoListener;

import org.jetbrains.annotations.NotNull;
Expand All @@ -40,7 +41,7 @@ public class RNPurchasesModule extends ReactContextBaseJavaModule implements Upd

private static final String PURCHASER_INFO_UPDATED = "Purchases-PurchaserInfoUpdated";
public static final String PLATFORM_NAME = "react-native";
public static final String PLUGIN_VERSION = "3.3.3";
public static final String PLUGIN_VERSION = "3.4.0";

private final ReactApplicationContext reactContext;

Expand Down Expand Up @@ -82,7 +83,7 @@ public void setAllowSharingStoreAccount(boolean allowSharingStoreAccount) {
@ReactMethod
public void addAttributionData(ReadableMap data, Integer network, @Nullable String networkUserId) {
try {
CommonKt.addAttributionData(RNPurchasesConverters.convertReadableMapToJson(data), network, networkUserId);
SubscriberAttributesKt.addAttributionData(RNPurchasesConverters.convertReadableMapToJson(data), network, networkUserId);
} catch (JSONException e) {
Log.e("RNPurchases", "Error parsing attribution date to JSON: " + e.getLocalizedMessage());
}
Expand Down Expand Up @@ -210,7 +211,7 @@ public void checkTrialOrIntroductoryPriceEligibility(ReadableArray productIDs, f
public void onReceived(@NonNull PurchaserInfo purchaserInfo) {
reactContext.getJSModule(DeviceEventManagerModule.RCTDeviceEventEmitter.class)
.emit(RNPurchasesModule.PURCHASER_INFO_UPDATED,
convertMapToWriteableMap(MappersKt.map((purchaserInfo))));
convertMapToWriteableMap(PurchaserInfoMapperKt.map(purchaserInfo)));
}

@ReactMethod
Expand All @@ -230,29 +231,97 @@ public void setProxyURLString(String proxyURLString) {
@ReactMethod
public void setAttributes(ReadableMap attributes) {
HashMap attributesHashMap = attributes.toHashMap();
CommonKt.setAttributes(attributesHashMap);
SubscriberAttributesKt.setAttributes(attributesHashMap);
}

@ReactMethod
public void setEmail(String email) {
CommonKt.setEmail(email);
SubscriberAttributesKt.setEmail(email);
}

@ReactMethod
public void setPhoneNumber(String phoneNumber) {
CommonKt.setPhoneNumber(phoneNumber);
SubscriberAttributesKt.setPhoneNumber(phoneNumber);
}

@ReactMethod
public void setDisplayName(String displayName) {
CommonKt.setDisplayName(displayName);
SubscriberAttributesKt.setDisplayName(displayName);
}

@ReactMethod
public void setPushToken(String pushToken) {
CommonKt.setPushToken(pushToken);
SubscriberAttributesKt.setPushToken(pushToken);
}

// region Attribution IDs

@ReactMethod
public void collectDeviceIdentifiers() {
SubscriberAttributesKt.collectDeviceIdentifiers();
}

@ReactMethod
public void setAdjustID(String adjustID) {
SubscriberAttributesKt.setAdjustID(adjustID);
}

@ReactMethod
public void setAppsflyerID(String appsflyerID) {
SubscriberAttributesKt.setAppsflyerID(appsflyerID);
}

@ReactMethod
public void setFBAnonymousID(String fbAnonymousID) {
SubscriberAttributesKt.setFBAnonymousID(fbAnonymousID);
}

@ReactMethod
public void setMparticleID(String mparticleID) {
SubscriberAttributesKt.setMparticleID(mparticleID);
}

@ReactMethod
public void setOnesignalID(String onesignalID) {
SubscriberAttributesKt.setOnesignalID(onesignalID);
}

// endregion

// region Campaign parameters

@ReactMethod
public void setMediaSource(String mediaSource) {
SubscriberAttributesKt.setMediaSource(mediaSource);
}

@ReactMethod
public void setCampaign(String campaign) {
SubscriberAttributesKt.setCampaign(campaign);
}

@ReactMethod
public void setAdGroup(String adGroup) {
SubscriberAttributesKt.setAdGroup(adGroup);
}

@ReactMethod
public void setAd(String ad) {
SubscriberAttributesKt.setAd(ad);
}

@ReactMethod
public void setKeyword(String keyword) {
SubscriberAttributesKt.setKeyword(keyword);
}

@ReactMethod
public void setCreative(String creative) {
SubscriberAttributesKt.setCreative(creative);
}

// endregion

//================================================================================
// Private methods
//================================================================================
Expand Down
4 changes: 2 additions & 2 deletions build.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ if (os.type() === "Linux") {
console.log("Skipping iOS Dependencies");
} else if (os.type() === "Darwin") {
const downloadProcess = exec(
"./scripts/download-purchases-framework.sh 3.5.1"
"./scripts/download-purchases-framework.sh 3.7.1"
);
downloadProcess.stdout.pipe(process.stdout);
const downloadProcessCommon = exec(
"./scripts/download-purchases-common.sh 1.3.1"
"./scripts/download-purchases-common.sh 1.4.1"
);
downloadProcessCommon.stdout.pipe(process.stdout);
} else if (os.type() === "Windows_NT") {
Expand Down
22 changes: 13 additions & 9 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ PODS:
- OpenSSL-Universal (1.0.2.19):
- OpenSSL-Universal/Static (= 1.0.2.19)
- OpenSSL-Universal/Static (1.0.2.19)
- Purchases (3.5.1)
- PurchasesHybridCommon (1.3.1):
- Purchases (= 3.5.1)
- Purchases (3.7.1):
- PurchasesCoreSwift (= 3.7.1)
- PurchasesCoreSwift (3.7.1)
- PurchasesHybridCommon (1.4.1):
- Purchases (= 3.7.1)
- RCTRequired (0.62.2)
- RCTTypeSafety (0.62.2):
- FBLazyVector (= 0.62.2)
Expand Down Expand Up @@ -297,8 +299,8 @@ PODS:
- ReactCommon/callinvoker (= 0.62.2)
- RNGestureHandler (1.4.0):
- React
- RNPurchases (3.3.3):
- PurchasesHybridCommon (= 1.3.1)
- RNPurchases (3.4.0):
- PurchasesHybridCommon (= 1.4.1)
- React
- RNScreens (1.0.0-alpha.23):
- React
Expand Down Expand Up @@ -358,6 +360,7 @@ SPEC REPOS:
- FlipperKit
- OpenSSL-Universal
- Purchases
- PurchasesCoreSwift
- PurchasesHybridCommon
- YogaKit

Expand Down Expand Up @@ -436,8 +439,9 @@ SPEC CHECKSUMS:
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
Purchases: 179946fa6d4484d11eacd3f9b39564a61886adc3
PurchasesHybridCommon: ea0ef35d54f4113fd982cd81b2c9551357e62247
Purchases: 81efbd7dc9164247a0885ad12ddf6b043a58c1db
PurchasesCoreSwift: eca892b2a0eff34d55d70e7c3349c1eb4c7659f5
PurchasesHybridCommon: 201dc69e8e5baa700c1e47f518810f35e745dd58
RCTRequired: cec6a34b3ac8a9915c37e7e4ad3aa74726ce4035
RCTTypeSafety: 93006131180074cffa227a1075802c89a49dd4ce
React: 29a8b1a02bd764fb7644ef04019270849b9a7ac3
Expand All @@ -458,11 +462,11 @@ SPEC CHECKSUMS:
React-RCTVibration: 4356114dbcba4ce66991096e51a66e61eda51256
ReactCommon: ed4e11d27609d571e7eee8b65548efc191116eb3
RNGestureHandler: 71871d4792db2a73f70204483d30350ec9384cbd
RNPurchases: f0ce418eedb6ed16c5ccf871ec65253b40d93b4a
RNPurchases: 7bef8d26c985f55b0df88ff893aa49e132e8392a
RNScreens: f28b48b8345f2f5f39ed6195518291515032a788
Yoga: 3ebccbdd559724312790e7742142d062476b698e
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 168d9768ab4ac5ea08878bbe678ab8e49d381544

COCOAPODS: 1.9.3
COCOAPODS: 1.10.0.rc.1
6 changes: 4 additions & 2 deletions example/ios/ReactNativeSample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,13 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 4;
DEAD_CODE_STRIPPING = NO;
DEVELOPMENT_TEAM = 8SXR2327BM;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = ReactNativeSample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 4.0;
OTHER_CFLAGS = (
"$(inherited)",
"-DFB_SONARKIT_ENABLED=1",
Expand All @@ -298,10 +299,11 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 8SXR2327BM;
INFOPLIST_FILE = ReactNativeSample/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = 4.0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I increased the version when validating. I can rollback if necessary, but I don't think it hurts

OTHER_CFLAGS = (
"$(inherited)",
"-DFB_SONARKIT_ENABLED=1",
Expand Down
Loading