Skip to content

Commit

Permalink
[SDK-2199] Added addSnapPartnerParam() (#922)
Browse files Browse the repository at this point in the history
* Added addSnapPartnerParameter

* Fixed tab
  • Loading branch information
nsingh-branch authored Jan 3, 2024
1 parent 7083ccd commit 949648a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions android/src/main/java/io/branch/rnbranch/RNBranchModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
8 changes: 8 additions & 0 deletions ios/RNBranch.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ interface Branch {
setIdentityAsync: (identity: string) => Promise<BranchParams>;
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;
Expand Down
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 949648a

Please sign in to comment.