@@ -88,7 +88,6 @@ public class RNBranchModule extends ReactContextBaseJavaModule {
8888 private static Branch .BranchUniversalReferralInitListener initListener = null ;
8989
9090 private static Activity mActivity = null ;
91- private static boolean mUseDebug = false ;
9291 private static boolean mInitialized = false ;
9392 private static volatile boolean mNewIntent = true ;
9493 private static JSONObject mRequestMetadata = new JSONObject ();
@@ -98,26 +97,8 @@ public class RNBranchModule extends ReactContextBaseJavaModule {
9897 private static Branch .BranchReferralInitListener referralInitListener = null ;
9998
10099 public static void getAutoInstance (Context context ) {
101- RNBranchConfig config = new RNBranchConfig (context );
102- String branchKey = config .getBranchKey ();
103- String liveKey = config .getLiveKey ();
104- String testKey = config .getTestKey ();
105- boolean useTest = config .getUseTestInstance ();
106-
107100 Branch .registerPlugin (PLUGIN_NAME , io .branch .rnbranch .BuildConfig .RNBRANCH_VERSION );
108-
109- if (branchKey != null ) {
110- Branch .getAutoInstance (context , branchKey );
111- }
112- else if (useTest && testKey != null ) {
113- Branch .getAutoInstance (context , testKey );
114- }
115- else if (!useTest && liveKey != null ) {
116- Branch .getAutoInstance (context , liveKey );
117- }
118- else {
119- Branch .getAutoInstance (context );
120- }
101+ Branch .getAutoInstance (context );
121102 }
122103
123104 public static void reInitSession (Activity reactActivity ) {
@@ -257,8 +238,15 @@ private static void notifyJSOfInitSessionStart(Context context, Uri uri) {
257238 Log .d (REACT_CLASS , "Sent session start broadcast for " + uri );
258239 }
259240
260- public static void setDebug () {
261- mUseDebug = true ;
241+ /**
242+ * @deprecated setDebug is deprecated and all functionality has been disabled. If you wish to enable
243+ * logging, please invoke enableLogging. If you wish to simulate installs, please Test Devices
244+ * (https://help.branch.io/using-branch/docs/adding-test-devices)
245+ */
246+ public static void setDebug () { }
247+
248+ public static void enableLogging () {
249+ Branch .enableLogging ();
262250 }
263251
264252 public static void setRequestMetadata (String key , String val ) {
@@ -439,7 +427,7 @@ public void lastAttributedTouchData(int window, final Promise promise) {
439427 @ Override
440428 public void onDataFetched (JSONObject jsonObject , BranchError error ) {
441429 if (error == null ) {
442- promise .resolve (jsonObject );
430+ promise .resolve (convertJsonToMap ( jsonObject ) );
443431 } else {
444432 promise .reject (GENERIC_ERROR , error .getMessage ());
445433 }
@@ -460,6 +448,18 @@ public void setRequestMetadataKey(String key, String value) {
460448 branch .setRequestMetadata (key , value );
461449 }
462450
451+ @ ReactMethod
452+ public void addFacebookPartnerParameter (String name , String value ) {
453+ Branch branch = Branch .getInstance ();
454+ branch .addFacebookPartnerParameterWithName (name , value );
455+ }
456+
457+ @ ReactMethod
458+ public void clearPartnerParameters () {
459+ Branch branch = Branch .getInstance ();
460+ branch .clearPartnerParameters ();
461+ }
462+
463463 @ ReactMethod
464464 public void logout () {
465465 Branch branch = Branch .getInstance ();
@@ -748,12 +748,6 @@ private static Branch setupBranch(Context context) {
748748 if (!mInitialized ) {
749749 Log .i (REACT_CLASS , "Initializing Branch SDK v. " + BuildConfig .VERSION_NAME );
750750
751- RNBranchConfig config = new RNBranchConfig (context );
752-
753- if (mUseDebug || config .getDebugMode ()) branch .setDebug ();
754-
755- if (config .getEnableFacebookLinkCheck ()) branch .enableFacebookAppLinkCheck ();
756-
757751 if (mRequestMetadata != null ) {
758752 Iterator keys = mRequestMetadata .keys ();
759753 while (keys .hasNext ()) {
0 commit comments