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-2524] Added CPP level support to React Native and release 6.5.0 #1059

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2025-1-13 Version 6.5.0
- Update iOS SDK to 3.8.0
- Update Android SDK to 5.15.0
- Exposed new method `setConsumerProtectionAttributionLevel` to set CPP level

2024-10-29 Version 6.4.0
- Update iOS SDK to 3.6.5
- Update Android SDK to 5.13.0
Expand Down
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.12.4'
api 'io.branch.sdk.android:library:5.15.0'
}
26 changes: 26 additions & 0 deletions android/src/main/java/io/branch/rnbranch/RNBranchModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -1251,4 +1251,30 @@ public void setDMAParamsForEEA(boolean eeaRegion, boolean adPersonalizationConse
Branch branch = Branch.getInstance();
branch.setDMAParamsForEEA(eeaRegion, adPersonalizationConsent, adUserDataUsageConsent);
}

@ReactMethod
public void setConsumerProtectionAttributionLevel(String level) {
Branch branch = Branch.getInstance();
BranchAttributionLevel attributionLevel;

switch (level) {
case "FULL":
attributionLevel = BranchAttributionLevel.FULL;
break;
case "REDUCED":
attributionLevel = BranchAttributionLevel.REDUCED;
break;
case "MINIMAL":
attributionLevel = BranchAttributionLevel.MINIMAL;
break;
case "NONE":
attributionLevel = BranchAttributionLevel.NONE;
break;
default:
Log.w(REACT_CLASS, "Invalid attribution level: " + level);
return;
}

branch.setConsumerProtectionAttributionLevel(attributionLevel);
}
}
5 changes: 5 additions & 0 deletions branchreactnativetestbed/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ class App extends React.Component<any, MyState> {
onPress: this.branchWrapper.viewFirstReferringParams.bind(this),
image: require('./images/download_FILL1_wght400_GRAD0_opsz48.png'),
},
{
text: 'Set Attribution Level',
onPress: () => this.branchWrapper.setConsumerProtectionAttributionLevel('REDUCED'),
image: require('./images/person_FILL1_wght400_GRAD0_opsz48.png'),
},
{
text: 'View Latest Params',
onPress: this.branchWrapper.viewLatestReferringParams.bind(this),
Expand Down
6 changes: 6 additions & 0 deletions branchreactnativetestbed/components/BranchWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ export default class BranchWrapper {
});
};

setConsumerProtectionAttributionLevel = (level: 'FULL' | 'REDUCED' | 'MINIMAL' | 'NONE') => {
console.log('BranchWrapper setConsumerProtectionAttributionLevel ' + level);
branch.setConsumerProtectionAttributionLevel(level);
this.createAlert('Attribution Level Set', `Level set to: ${level}`);
};

toggleTracking = async () => {
let trackingDisabled = await branch.isTrackingDisabled();

Expand Down
Loading
Loading