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

Expose native layer Integration Validator #1038

Merged
merged 9 commits into from
Dec 13, 2024
Merged
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 @@ -26,6 +26,7 @@
import io.branch.referral.QRCode.BranchQRCode;
import io.branch.referral.util.*;
import io.branch.referral.Branch;
import io.branch.referral.validators.IntegrationValidator;
import io.branch.indexing.*;

import org.json.*;
Expand Down Expand Up @@ -1251,4 +1252,9 @@ public void setDMAParamsForEEA(boolean eeaRegion, boolean adPersonalizationConse
Branch branch = Branch.getInstance();
branch.setDMAParamsForEEA(eeaRegion, adPersonalizationConsent, adUserDataUsageConsent);
}

@ReactMethod
public void validateSDKIntegration() {
IntegrationValidator.validate(mActivity);
}
}
10 changes: 10 additions & 0 deletions branchreactnativetestbed/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class App extends React.Component<any, MyState> {
data: BranchButton[];
events: BranchButton[];
sections: BranchSection[];
testing: BranchButton[];

constructor(props: any) {
super(props);
Expand Down Expand Up @@ -154,10 +155,19 @@ class App extends React.Component<any, MyState> {
},
];

this.testing = [
{
text: 'Validate SDK Integration',
onPress: this.branchWrapper.validateSDKIntegration.bind(this),
image: require('./images/attach_money_FILL1_wght400_GRAD0_opsz48.png'),
}
];

this.sections = [
{ sectionName: 'Linking', branchButtons: this.linking },
{ sectionName: 'Data', branchButtons: this.data },
{ sectionName: 'Events', branchButtons: this.events },
{ sectionName: 'Testing', branchButtons: this.testing }
];
}

Expand Down
2 changes: 1 addition & 1 deletion branchreactnativetestbed/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
rootProject.name = 'branchreactnativetestbed'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
includeBuild('../node_modules/@react-native/gradle-plugin')
4 changes: 4 additions & 0 deletions branchreactnativetestbed/components/BranchWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,8 @@ export default class BranchWrapper {
'This alert was dismissed by tapping outside of the alert dialog.',
),
});

validateSDKIntegration = () => {
branch.validateSDKIntegration();
};
}
Loading
Loading