Skip to content

Commit 2a7a206

Browse files
authored
Merge pull request #506 from BranchMetrics/staging
SDK-509 update react native
2 parents 409ea48 + 90383f7 commit 2a7a206

File tree

8 files changed

+33
-28
lines changed

8 files changed

+33
-28
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2019-09-27 Version 4.2.0
2+
- Update Android Branch SDK to 4.1.0
3+
- Update iOS Branch SDK to 0.29.0
4+
- Expose Android reInit session for foreground links
5+
16
2019-07-25 Version 3.1.1
27
- Requires RN < 0.60
38
- Fix a runtime iOS issue in 3.1.0

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ android {
2222

2323
dependencies {
2424
implementation 'com.facebook.react:react-native:+' // From node_modules
25-
api 'io.branch.sdk.android:library:3.2.0'
25+
api 'io.branch.sdk.android:library:4.1.0'
2626
}

android/src/main/java/io/branch/rnbranch/RNBranchModule.java

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ public class RNBranchModule extends ReactContextBaseJavaModule {
8585

8686
private AgingHash<String, BranchUniversalObject> mUniversalObjectMap = new AgingHash<>(AGING_HASH_TTL);
8787

88+
private static Branch.BranchReferralInitListener referralInitListener = null;
89+
8890
public static void getAutoInstance(Context context) {
8991
RNBranchConfig config = new RNBranchConfig(context);
9092
String branchKey = config.getBranchKey();
@@ -106,6 +108,11 @@ else if (!useTest && liveKey != null) {
106108
}
107109
}
108110

111+
public static void reInitSession(Activity reactActivity) {
112+
Branch branch = Branch.getInstance();
113+
branch.reInitSession(reactActivity, referralInitListener);
114+
}
115+
109116
public static void initSession(final Uri uri, Activity reactActivity, Branch.BranchUniversalReferralInitListener anInitListener) {
110117
initListener = anInitListener;
111118
initSession(uri, reactActivity);
@@ -115,7 +122,7 @@ public static void initSession(final Uri uri, Activity reactActivity) {
115122
Branch branch = setupBranch(reactActivity.getApplicationContext());
116123

117124
mActivity = reactActivity;
118-
branch.initSession(new Branch.BranchReferralInitListener(){
125+
referralInitListener = new Branch.BranchReferralInitListener(){
119126

120127
private Activity mmActivity = null;
121128

@@ -208,7 +215,9 @@ private void generateLocalBroadcast(JSONObject referringParams,
208215

209216
LocalBroadcastManager.getInstance(mmActivity).sendBroadcast(broadcastIntent);
210217
}
211-
}.init(reactActivity), uri, reactActivity);
218+
}.init(reactActivity);
219+
220+
branch.initSession(referralInitListener, uri, reactActivity);
212221
}
213222

214223
public static void setDebug() {
@@ -247,13 +256,13 @@ public Map<String, Object> getConstants() {
247256

248257
// Constants for use with userCompletedAction (deprecated)
249258

250-
constants.put(ADD_TO_CART_EVENT, BranchEvent.ADD_TO_CART);
251-
constants.put(ADD_TO_WISHLIST_EVENT, BranchEvent.ADD_TO_WISH_LIST);
252-
constants.put(PURCHASED_EVENT, BranchEvent.PURCHASED);
253-
constants.put(PURCHASE_INITIATED_EVENT, BranchEvent.PURCHASE_STARTED);
254-
constants.put(REGISTER_VIEW_EVENT, BranchEvent.VIEW);
255-
constants.put(SHARE_COMPLETED_EVENT, BranchEvent.SHARE_COMPLETED);
256-
constants.put(SHARE_INITIATED_EVENT, BranchEvent.SHARE_STARTED);
259+
// constants.put(ADD_TO_CART_EVENT, BranchEvent.ADD_TO_CART);
260+
// constants.put(ADD_TO_WISHLIST_EVENT, BranchEvent.ADD_TO_WISH_LIST);
261+
// constants.put(PURCHASED_EVENT, BranchEvent.PURCHASED);
262+
// constants.put(PURCHASE_INITIATED_EVENT, BranchEvent.PURCHASE_STARTED);
263+
// constants.put(REGISTER_VIEW_EVENT, BranchEvent.VIEW);
264+
// constants.put(SHARE_COMPLETED_EVENT, BranchEvent.SHARE_COMPLETED);
265+
// constants.put(SHARE_INITIATED_EVENT, BranchEvent.SHARE_STARTED);
257266

258267
// constants for use with BranchEvent
259268

examples/testbed_simple/ios/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PODS:
22
- boost-for-react-native (1.63.0)
3-
- Branch (0.27.1):
4-
- Branch/Core (= 0.27.1)
5-
- Branch/Core (0.27.1)
3+
- Branch (0.28.1):
4+
- Branch/Core (= 0.28.1)
5+
- Branch/Core (0.28.1)
66
- DoubleConversion (1.1.6)
77
- Folly (2018.10.22.00):
88
- boost-for-react-native
@@ -61,7 +61,7 @@ PODS:
6161
- React-jsi (= 0.60.3)
6262
- React-jsinspector (0.60.3)
6363
- react-native-branch (4.1.0):
64-
- Branch (= 0.27.1)
64+
- Branch (= 0.28.1)
6565
- React
6666
- React-RCTActionSheet (0.60.3):
6767
- React-Core (= 0.60.3)
@@ -169,7 +169,7 @@ EXTERNAL SOURCES:
169169

170170
SPEC CHECKSUMS:
171171
boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c
172-
Branch: 1ace77c04b6e3efbf982bf4364f0662bfac156a0
172+
Branch: edf6cab0cecb437d6a6abba3a25d0a0fa6f277ec
173173
DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2
174174
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
175175
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
@@ -181,7 +181,7 @@ SPEC CHECKSUMS:
181181
React-jsi: c2b6e57836bcae2677a036384111dc2c58e94369
182182
React-jsiexecutor: d9023c5c199114d2b6f38ec861a4d923c73d0735
183183
React-jsinspector: 817b64f3c8a807f09d78620f4f505868d89b26f3
184-
react-native-branch: 861e9210afb3a52317fe4cc6a04086a9250f71b8
184+
react-native-branch: 8e9dec04d5f52b3eab6970effcb01ed163351d3e
185185
React-RCTActionSheet: 9c42321fd5652515d706dd722c5a10b1970d7ec8
186186
React-RCTAnimation: fabb087dde8964c9a835a7fabd0e7e5701787913
187187
React-RCTBlob: 93f34281d9c9c9e216b25824309eed9fe22a5d41

ios/RNBranch.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ extern NSString * _Nonnull const RNBranchLinkOpenedNotificationLinkPropertiesKey
2828

2929
+ (void)setDebug;
3030
+ (void)delayInitToCheckForSearchAds;
31-
+ (void)setAppleSearchAdsDebugMode;
3231
+ (void)setRequestMetadataKey:(NSString * _Nonnull)key value:(NSObject * _Nonnull)value;
3332

3433
@end

ios/RNBranch.m

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
static NSString * const RNBranchErrorDomain = @"RNBranchErrorDomain";
3030
static NSInteger const RNBranchUniversalObjectNotFoundError = 1;
3131

32-
static NSString * const REQUIRED_BRANCH_SDK = @"0.27.1";
32+
static NSString * const REQUIRED_BRANCH_SDK = @"0.28.1";
3333

3434
#pragma mark - Private RNBranch declarations
3535

@@ -89,9 +89,6 @@ + (void)setupBranchInstance:(Branch *)instance
8989
if (config.delayInitToCheckForSearchAds) {
9090
[instance delayInitToCheckForSearchAds];
9191
}
92-
if (config.appleSearchAdsDebugMode) {
93-
[instance setAppleSearchAdsDebugMode];
94-
}
9592
}
9693

9794
- (NSDictionary<NSString *, NSString *> *)constantsToExport {
@@ -147,11 +144,6 @@ + (void)delayInitToCheckForSearchAds
147144
[self.branch delayInitToCheckForSearchAds];
148145
}
149146

150-
+ (void)setAppleSearchAdsDebugMode
151-
{
152-
[self.branch setAppleSearchAdsDebugMode];
153-
}
154-
155147
+ (void)setRequestMetadataKey:(NSString *)key value:(NSObject *)value
156148
{
157149
[self.branch setRequestMetadataKey:key value:value];

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-branch",
3-
"version": "4.1.1",
3+
"version": "4.2.0",
44
"description": "Branch Metrics React Native SDK",
55
"main": "src/index.js",
66
"files": [

react-native-branch.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ Pod::Spec.new do |s|
2121
s.source = { spec['repository']['type'].to_sym => spec['repository']['url'].sub(/^[a-z]+\+/, '') }
2222
s.source_files = [ "ios/*.h", "ios/*.m"]
2323
s.header_dir = 'RNBranch' # also sets generated module name
24-
s.dependency 'Branch', '0.27.1'
24+
s.dependency 'Branch', '0.29.0'
2525
s.dependency 'React' # to ensure the correct build order
2626
end

0 commit comments

Comments
 (0)