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 3 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
1,053 changes: 560 additions & 493 deletions ChangeLog.md

Large diffs are not rendered by default.

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'
}
14 changes: 6 additions & 8 deletions android/src/main/java/io/branch/rnbranch/RNBranchModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,6 @@ private static void notifyJSOfInitSessionStart(Context context, Uri uri) {
LocalBroadcastManager.getInstance(context).sendBroadcast(broadcastIntent);
}

/**
* @deprecated setDebug is deprecated and all functionality has been disabled. If you wish to enable
* logging, please invoke enableLogging. If you wish to simulate installs, please Test Devices
* (https://help.branch.io/using-branch/docs/adding-test-devices)
*/
@Deprecated
public static void setDebug() { }

public static void enableLogging() {
Branch.enableLogging();
}
Expand Down Expand Up @@ -1253,4 +1245,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);
}
}
45 changes: 0 additions & 45 deletions docs/setDebug.md

This file was deleted.

1 change: 0 additions & 1 deletion ios/RNBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ extern NSString * _Nonnull const RNBranchLinkOpenedNotificationLinkPropertiesKey
+ (void)useTestInstance;
+ (void)deferInitializationForJSLoad;

+ (void)setDebug;
+ (void)enableLogging;

@end
10 changes: 5 additions & 5 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 @@ -109,11 +109,6 @@ + (BOOL)requiresMainQueueSetup {

#pragma mark - Class methods

+ (void)setDebug
{
[self.branch setDebug];
}

+ (void)enableLogging
{
[self.branch enableLogging];
Expand Down Expand Up @@ -744,4 +739,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;
6 changes: 5 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
isTrackingDisabled = RNBranch.isTrackingDisabled

/*** RNBranch singleton methods ***/
setDebug = () => { throw 'setDebug() is not supported in the RN SDK. For other solutions, please see https://rnbranch.app.link/setDebug' }
getLatestReferringParams = (synchronous = false) => RNBranch.getLatestReferringParams(synchronous)
getFirstReferringParams = RNBranch.getFirstReferringParams
lastAttributedTouchData = (attributionWindow = {}) => RNBranch.lastAttributedTouchData(attributionWindow)
Expand Down Expand Up @@ -123,6 +122,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 127 in src/index.js

View check run for this annotation

Codecov / codecov/patch

src/index.js#L127

Added line #L127 was not covered by tests
}

}

export { Branch, BranchEvent, BranchSubscriber }
Expand Down
Loading