Skip to content

Commit e9ccc6c

Browse files
committed
Added CPP method
1 parent 9a4d358 commit e9ccc6c

File tree

14 files changed

+7330
-18268
lines changed

14 files changed

+7330
-18268
lines changed

ChangeLog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2025-1-13 Version 6.5.0
2+
- Update iOS SDK to 3.8.0
3+
- Update Android SDK to 5.15.0
4+
- Exposed new method `setConsumerProtectionAttributionLevel` to set CPP level
5+
16
2024-10-29 Version 6.4.0
27
- Update iOS SDK to 3.6.5
38
- Update Android SDK to 5.13.0

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,5 @@ def safeExtGet(prop, fallback) {
4747
dependencies {
4848
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
4949
implementation 'com.facebook.react:react-native:+' // From node_modules
50-
api 'io.branch.sdk.android:library:5.12.4'
50+
api 'io.branch.sdk.android:library:5.15.0'
5151
}

android/src/main/java/io/branch/rnbranch/RNBranchModule.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,4 +1251,30 @@ public void setDMAParamsForEEA(boolean eeaRegion, boolean adPersonalizationConse
12511251
Branch branch = Branch.getInstance();
12521252
branch.setDMAParamsForEEA(eeaRegion, adPersonalizationConsent, adUserDataUsageConsent);
12531253
}
1254+
1255+
@ReactMethod
1256+
public void setConsumerProtectionAttributionLevel(String level) {
1257+
Branch branch = Branch.getInstance();
1258+
BranchAttributionLevel attributionLevel;
1259+
1260+
switch (level) {
1261+
case "FULL":
1262+
attributionLevel = BranchAttributionLevel.FULL;
1263+
break;
1264+
case "REDUCED":
1265+
attributionLevel = BranchAttributionLevel.REDUCED;
1266+
break;
1267+
case "MINIMAL":
1268+
attributionLevel = BranchAttributionLevel.MINIMAL;
1269+
break;
1270+
case "NONE":
1271+
attributionLevel = BranchAttributionLevel.NONE;
1272+
break;
1273+
default:
1274+
Log.w(REACT_CLASS, "Invalid attribution level: " + level);
1275+
return;
1276+
}
1277+
1278+
branch.setConsumerProtectionAttributionLevel(attributionLevel);
1279+
}
12541280
}

branchreactnativetestbed/App.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ class App extends React.Component<any, MyState> {
9797
onPress: this.branchWrapper.viewFirstReferringParams.bind(this),
9898
image: require('./images/download_FILL1_wght400_GRAD0_opsz48.png'),
9999
},
100+
{
101+
text: 'Set Attribution Level',
102+
onPress: () => this.branchWrapper.setConsumerProtectionAttributionLevel('REDUCED'),
103+
image: require('./images/person_FILL1_wght400_GRAD0_opsz48.png'),
104+
},
100105
{
101106
text: 'View Latest Params',
102107
onPress: this.branchWrapper.viewLatestReferringParams.bind(this),

branchreactnativetestbed/components/BranchWrapper.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,12 @@ export default class BranchWrapper {
209209
});
210210
};
211211

212+
setConsumerProtectionAttributionLevel = (level: 'FULL' | 'REDUCED' | 'MINIMAL' | 'NONE') => {
213+
console.log('BranchWrapper setConsumerProtectionAttributionLevel ' + level);
214+
branch.setConsumerProtectionAttributionLevel(level);
215+
this.createAlert('Attribution Level Set', `Level set to: ${level}`);
216+
};
217+
212218
toggleTracking = async () => {
213219
let trackingDisabled = await branch.isTrackingDisabled();
214220

0 commit comments

Comments
 (0)