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-2249] Expose the setDMAParamsForEEA method #957

Merged
merged 5 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,5 @@ def safeExtGet(prop, fallback) {
dependencies {
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'com.facebook.react:react-native:+' // From node_modules
api 'io.branch.sdk.android:library:5.7.1'
api 'io.branch.sdk.android:library:5.9.0'
}
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 @@ -1253,4 +1253,10 @@ private static WritableArray convertJsonToArray(JSONArray jsonArray) throws JSON
}
return array;
}

@ReactMethod
public void setDMAParamsForEEA(boolean eeaRegion, boolean adPersonalizationConsent, boolean adUserDataUsageConsent) {
Branch branch = Branch.getInstance();
branch.setDMAParamsForEEA(eeaRegion, adPersonalizationConsent, adUserDataUsageConsent);
}
}
5 changes: 5 additions & 0 deletions ios/RNBranch.m
nsingh-branch marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -744,4 +744,9 @@ - (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start le
return hexComponent / 255.0;
}

#pragma mark setDMAParamsForEEA
RCT_EXPORT_METHOD(setDMAParamsForEEA:(BOOL)eeaRegion AdPersonalizationConsent:(BOOL)adPersonalizationConsent AdUserDataUsageConsent:(BOOL)adUserDataUsageConsent) {
[Branch setDMAParamsForEEA:eeaRegion AdPersonalizationConsent:adPersonalizationConsent AdUserDataUsageConsent:adUserDataUsageConsent];
}

@end
2 changes: 1 addition & 1 deletion react-native-branch.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Pod::Spec.new do |s|
s.source_files = [ "ios/*.h", "ios/*.m"]
s.compiler_flags = %[-DRNBRANCH_VERSION=@\\"#{s.version}\\"]
s.header_dir = 'RNBranch' # also sets generated module name
s.dependency 'BranchSDK', '3.0.0'
s.dependency 'BranchSDK', '3.3.0'
s.dependency 'React-Core' # to ensure the correct build order

# Swift/Objective-C compatibility
Expand Down
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ interface Branch {
) => Promise<string>;
setPreInstallCampaign: (campaign: string) => void;
setPreInstallPartner: (partner: string) => void;
setDMAParamsForEEA: (eeaRegion: boolean, adPersonalizationConsent: boolean, adUserDataUsageConsent: boolean) => void;
}
declare const branch: Branch;
export default branch;
5 changes: 5 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@
setPreInstallCampaign = (campaign) => RNBranch.setPreinstallCampaign(campaign)
setPreInstallPartner = (partner) => RNBranch.setPreinstallPartner(partner)

/*** DMA Consent Params ***/
setDMAParamsForEEA = (eeaRegion, adPersonalizationConsent, adUserDataUsageConsent) => {
RNBranch.setDMAParamsForEEA(eeaRegion, adPersonalizationConsent, adUserDataUsageConsent);

Check warning on line 128 in src/index.js

View check run for this annotation

Codecov / codecov/patch

src/index.js#L128

Added line #L128 was not covered by tests
}

}

export { Branch, BranchEvent, BranchSubscriber }
Expand Down
Loading