From 5e0a95a690a0bd79581dbc0b196b4ec645ee9547 Mon Sep 17 00:00:00 2001 From: nsingh-branch Date: Wed, 13 Dec 2023 11:16:30 -0800 Subject: [PATCH 1/2] Added addSnapPartnerParameter --- .../src/main/java/io/branch/rnbranch/RNBranchModule.java | 6 ++++++ ios/RNBranch.m | 8 ++++++++ src/index.d.ts | 1 + src/index.js | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/android/src/main/java/io/branch/rnbranch/RNBranchModule.java b/android/src/main/java/io/branch/rnbranch/RNBranchModule.java index 9bc292233..41c2f5f7e 100644 --- a/android/src/main/java/io/branch/rnbranch/RNBranchModule.java +++ b/android/src/main/java/io/branch/rnbranch/RNBranchModule.java @@ -497,6 +497,12 @@ public void addFacebookPartnerParameter(String name, String value) { branch.addFacebookPartnerParameterWithName(name, value); } + @ReactMethod + public void addSnapPartnerParameter(String name, String value) { + Branch branch = Branch.getInstance(); + branch.addSnapPartnerParameterWithName(name, value); + } + @ReactMethod public void clearPartnerParameters() { Branch branch = Branch.getInstance(); diff --git a/ios/RNBranch.m b/ios/RNBranch.m index 7b0356d10..f681d2974 100644 --- a/ios/RNBranch.m +++ b/ios/RNBranch.m @@ -315,6 +315,14 @@ - (BranchUniversalObject *)findUniversalObjectWithIdent:(NSString *)ident reject [self.class.branch addFacebookPartnerParameterWithName:name value:value]; } +#pragma mark addSnapPartnerParameter +RCT_EXPORT_METHOD( + addSnapPartnerParameter:(NSString *)name + value:(NSString *)value + ) { + [self.class.branch addSnapPartnerParameterWithName:name value:value]; +} + #pragma mark disableTracking RCT_EXPORT_METHOD( disableTracking:(BOOL)disable diff --git a/src/index.d.ts b/src/index.d.ts index fc0ddac41..094b74512 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -328,6 +328,7 @@ interface Branch { setIdentityAsync: (identity: string) => Promise; setRequestMetadata: (key: string, value: string) => void; addFacebookPartnerParameter: (name: string, value: string) => void; + addSnapPartnerParameter: (name: string, value: string) => void; clearPartnerParameters: () => void; logout: () => void; openURL: (url: string, options?: { newActivity?: boolean }) => void; diff --git a/src/index.js b/src/index.js index fd6b88f82..8f7314667 100644 --- a/src/index.js +++ b/src/index.js @@ -71,6 +71,10 @@ class Branch { console.info('[Branch] addFacebookPartnerParameter has limitations when called from JS. Some network calls are made prior to the JS layer being available, those calls will not have the partner parameters.') return RNBranch.addFacebookPartnerParameter(name, value) } + addSnapPartnerParameter = (name, value) => { + console.info('[Branch] addSnapPartnerParameter has limitations when called from JS. Some network calls are made prior to the JS layer being available, those calls will not have the partner parameters.') + return RNBranch.addSnapPartnerParameter(name, value) + } clearPartnerParameters = RNBranch.clearPartnerParameters logout = RNBranch.logout getShortUrl = RNBranch.getShortUrl From c6da54995637b6a3b9d5ea914e347a8967055445 Mon Sep 17 00:00:00 2001 From: nsingh-branch Date: Wed, 13 Dec 2023 11:17:48 -0800 Subject: [PATCH 2/2] Fixed tab --- android/src/main/java/io/branch/rnbranch/RNBranchModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/io/branch/rnbranch/RNBranchModule.java b/android/src/main/java/io/branch/rnbranch/RNBranchModule.java index 41c2f5f7e..1e0a87c0b 100644 --- a/android/src/main/java/io/branch/rnbranch/RNBranchModule.java +++ b/android/src/main/java/io/branch/rnbranch/RNBranchModule.java @@ -497,7 +497,7 @@ public void addFacebookPartnerParameter(String name, String value) { branch.addFacebookPartnerParameterWithName(name, value); } - @ReactMethod + @ReactMethod public void addSnapPartnerParameter(String name, String value) { Branch branch = Branch.getInstance(); branch.addSnapPartnerParameterWithName(name, value);