Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SDK-2199] Added addSnapPartnerParam() #922

Merged
merged 2 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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