Skip to content

Commit bc41469

Browse files
Merge pull request #174 from BranchMetrics/SDK-795/fix_missing_params_set_plugin_type
Sdk 795/fix missing params set plugin type
2 parents cc63fd8 + 315d713 commit bc41469

File tree

14 files changed

+50
-36
lines changed

14 files changed

+50
-36
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ BranchUnityTestBed/Obj
77
BranchUnityTestBed/Build?
88
UnityConnectSettings.asset
99
ClusterInputManager.asset
10+
Logs/
11+
12+
# Android Studio
13+
.idea
14+
*.iml
15+
build/
16+
17+
# Mac stuff
18+
*.DS_Store

AndroidWrapperProject/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ android {
2525

2626
dependencies {
2727
// compile 'com.android.support:multidex:1.0.3'
28-
compile 'io.branch.sdk.android:library:4.2.1'
28+
compile 'io.branch.sdk.android:library:4.3.2'
2929
// Comment out the line above, uncomment the line below to use local Branch and update the settings.gradle file as well.
3030
// compile project(':Branch-SDK')
3131

AndroidWrapperProject/app/src/main/java/io/branch/unity/BranchUnityActivity.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import android.os.Bundle;
55
import android.content.Intent;
66

7+
import io.branch.referral.Defines;
8+
79
/**
810
* Created by antonarhunou on 10/13/16.
911
*/
@@ -16,6 +18,8 @@ public void onCreate(Bundle savedInstanceState) {
1618

1719
@Override
1820
public void onNewIntent(Intent intent) {
21+
super.onNewIntent(intent);
22+
intent.putExtra(Defines.Jsonkey.ForceNewBranchSession.getKey(), true);
1923
this.setIntent(intent);
2024

2125
BranchUnityWrapper.initSessionWithIntent();

AndroidWrapperProject/app/src/main/java/io/branch/unity/BranchUnityApp.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import android.app.Application;
44
import io.branch.referral.Branch;
55
import android.bluetooth.BluetoothSocket;
6+
import io.branch.referral.BranchUtil;
67
//import android.support.multidex.MultiDexApplication;
78

89
/**
@@ -13,7 +14,8 @@ public class BranchUnityApp extends Application {
1314
//public class BranchUnityApp extends MultiDexApplication {
1415
public void onCreate() {
1516
super.onCreate();
16-
17+
BranchUtil.setPluginType(BranchUtil.PluginType.Unity);
18+
BranchUtil.setPluginVersion("0.6.0");
1719
Branch.getAutoInstance(this.getApplicationContext());
1820
Branch.disableInstantDeepLinking(true);
1921
}

AndroidWrapperProject/app/src/main/java/io/branch/unity/BranchUnityWrapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public static void setBranchKey(String branchKey) {
5252

5353
public static void getAutoInstance() {
5454
Activity unityActivity = UnityPlayer.currentActivity;
55+
BranchUtil.setPluginType(BranchUtil.PluginType.Unity);
56+
BranchUtil.setPluginVersion("0.6.0");
5557
Branch.getAutoInstance(unityActivity.getApplicationContext());
5658
}
5759

@@ -70,8 +72,7 @@ public static void initSession(String callbackId) {
7072
autoInitCallbackWithParams = callbackId;
7173

7274
Activity unityActivity = UnityPlayer.currentActivity;
73-
// Branch.getInstance(UnityPlayer.currentActivity.getApplicationContext(), _branchKey).initSession(new BranchReferralInitListenerUnityCallback(callbackId), unityActivity.getIntent().getData(), unityActivity);
74-
Branch.getInstance(UnityPlayer.currentActivity.getApplicationContext(), _branchKey).reInitSession(unityActivity, new BranchReferralInitListenerUnityCallback(callbackId));
75+
Branch.getInstance(UnityPlayer.currentActivity.getApplicationContext(), _branchKey).initSession(new BranchReferralInitListenerUnityCallback(callbackId), unityActivity.getIntent().getData(), unityActivity);
7576
}
7677

7778
public static void initSession(String callbackId, boolean isReferrable) {
@@ -83,8 +84,7 @@ public static void initSessionWithUniversalObjectCallback(String callbackId) {
8384
autoInitCallbackWithBUO = callbackId;
8485

8586
Activity unityActivity = UnityPlayer.currentActivity;
86-
// Branch.getInstance(UnityPlayer.currentActivity.getApplicationContext(), _branchKey).initSession(new BranchUniversalReferralInitListenerUnityCallback(callbackId), unityActivity.getIntent().getData(), unityActivity);
87-
Branch.getInstance(UnityPlayer.currentActivity.getApplicationContext(), _branchKey).reInitSession(unityActivity, new BranchUniversalReferralInitListenerUnityCallback(callbackId));
87+
Branch.getInstance(UnityPlayer.currentActivity.getApplicationContext(), _branchKey).initSession(new BranchUniversalReferralInitListenerUnityCallback(callbackId), unityActivity.getIntent().getData(), unityActivity);
8888
}
8989

9090
public static void initSessionWithIntent() {

BranchUnityTestBed/Assets/Branch/Branch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
public class Branch : MonoBehaviour {
99

10-
public static string sdkVersion = "0.5.15";
10+
public static string sdkVersion = "0.6.0";
1111

1212
public delegate void BranchCallbackWithParams(Dictionary<string, object> parameters, string error);
1313
public delegate void BranchCallbackWithUrl(string url, string error);

BranchUnityTestBed/Assets/Plugins/Branch/Android/AndroidManifest.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@
2727
<meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
2828
</activity>
2929

30-
<!-- Add this for Branch for install referrer tracking-->
31-
<receiver android:name="io.branch.referral.InstallListener" android:exported="true">
32-
<intent-filter>
33-
<action android:name="com.android.vending.INSTALL_REFERRER" />
34-
</intent-filter>
35-
</receiver>
36-
3730
<!-- Optional. Set to true to disable auto deep link feature-->
3831
<meta-data android:name="io.branch.sdk.auto_link_disable" android:value="false"/>
3932

322 KB
Binary file not shown.

BranchUnityTestBed/Assets/Plugins/Branch/Android/libs/Branch-4.2.1_core.jar.meta renamed to BranchUnityTestBed/Assets/Plugins/Branch/Android/libs/Branch-4.3.2_core.jar.meta

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
344 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)