Skip to content

Commit 27c45b6

Browse files
Merge pull request #628 from BranchMetrics/staging
Release 4.1.3
2 parents 54664e1 + 00431ae commit 27c45b6

File tree

4 files changed

+9
-52
lines changed

4 files changed

+9
-52
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "branch-cordova-sdk",
33
"description": "Branch Metrics Cordova SDK",
44
"main": "src/index.js",
5-
"version": "4.1.2",
5+
"version": "4.1.3",
66
"homepage": "https://github.com/BranchMetrics/cordova-ionic-phonegap-branch-deep-linking",
77
"repository": {
88
"type": "git",

src/android/io/branch/BranchSDK.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ static class BranchLinkProperties extends io.branch.referral.util.LinkProperties
4545
// Standard Debugging Variables
4646
private static final String LCAT = "CordovaBranchSDK";
4747
// todo pick up plugin version dynamically
48-
private static final String BRANCH_PLUGIN_VERSION = "4.1.2";
48+
private static final String BRANCH_PLUGIN_VERSION = "4.1.3";
4949

5050
// Private Method Properties
5151
private ArrayList<BranchUniversalObjectWrapper> branchObjectWrappers;
5252
private Activity activity;
5353
private Branch instance;
5454
private String deepLinkUrl;
5555

56-
private SessionListener sessionListener;
57-
5856
/**
5957
* Class Constructor
6058
*/
@@ -87,8 +85,6 @@ protected void pluginInitialize() {
8785
public void onNewIntent(Intent intent) {
8886
intent.putExtra("branch_force_new_session", true);
8987
this.activity.setIntent(intent);
90-
91-
this.reInitSession();
9288
}
9389

9490
/**
@@ -298,17 +294,7 @@ private void initSession(CallbackContext callbackContext) {
298294
this.deepLinkUrl = data.toString();
299295
}
300296

301-
this.sessionListener = new SessionListener(callbackContext);
302-
this.instance.initSession(this.sessionListener, data, activity);
303-
}
304-
305-
private void reInitSession() {
306-
if (this.sessionListener == null) {
307-
return;
308-
}
309-
310-
this.activity = this.cordova.getActivity();
311-
this.instance.reInitSession(this.activity, this.sessionListener);
297+
this.instance.initSession(new SessionListener(callbackContext), data, activity);
312298
}
313299

314300
/**

src/ios/BranchSDK.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#import "BranchSDK.h"
22

3-
NSString * const pluginVersion = @"4.1.2";
3+
NSString * const pluginVersion = @"4.1.3";
44

55
@interface BranchSDK()
66

src/scripts/android/updateAndroidManifest.js

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
// update manifest
1818
manifest.file = updateBranchMetaData(manifest.file, preferences);
19-
manifest.file = updateBranchReferrerTracking(manifest.file);
19+
manifest.file = removeDeprecatedInstalReferrerBroadcastReceiver(manifest.file);
2020
manifest.file = updateLaunchOptionToSingleTask(
2121
manifest.file,
2222
manifest.mainActivityIndex
@@ -111,41 +111,12 @@
111111
return manifest;
112112
}
113113

114-
// adds to <application> for install referrer tracking (optional)
115-
// <receiver android:name="io.branch.referral.InstallListener" android:exported="true">
116-
// <intent-filter>
117-
// <action android:name="com.android.vending.INSTALL_REFERRER" />
118-
// </intent-filter>
119-
// </receiver>
120-
function updateBranchReferrerTracking(manifest) {
121-
let receivers = manifest.manifest.application[0].receiver || [];
114+
function removeDeprecatedInstalReferrerBroadcastReceiver(manifest) {
115+
let receivers = manifest.manifest.application[0].receiver || [];
122116
const androidName = "io.branch.referral.InstallListener";
117+
manifest.manifest.application[0].receiver = removeBasedOnAndroidName(receivers, androidName);
123118

124-
// remove old
125-
receivers = removeBasedOnAndroidName(receivers, androidName);
126-
127-
// add new
128-
manifest.manifest.application[0].receiver = receivers.concat([
129-
{
130-
$: {
131-
"android:name": androidName,
132-
"android:exported": true
133-
},
134-
"intent-filter": [
135-
{
136-
action: [
137-
{
138-
$: {
139-
"android:name": "com.android.vending.INSTALL_REFERRER"
140-
}
141-
}
142-
]
143-
}
144-
]
145-
}
146-
]);
147-
148-
return manifest;
119+
return manifest;
149120
}
150121

151122
// adds to main <activity>:

0 commit comments

Comments
 (0)