Skip to content

Commit

Permalink
Got the validator working for Android
Browse files Browse the repository at this point in the history
Got the validator working for Android
  • Loading branch information
rob-gioia-branch committed Oct 8, 2024
1 parent f1a243d commit d942560
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ 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'
implementation 'com.google.android.gms:play-services-base:18.5.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 @@ -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);
}
}
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();
};
}
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ interface Branch {
setPreInstallCampaign: (campaign: string) => void;
setPreInstallPartner: (partner: string) => void;
setDMAParamsForEEA: (eeaRegion: boolean, adPersonalizationConsent: boolean, adUserDataUsageConsent: boolean) => void;
validateSDKIntegration: () => void;
}
declare const branch: Branch;
export default branch;
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,10 @@ class Branch {
console.warn('setDMAParamsForEEA: Unable to set DMA params.');
}
};

validateSDKIntegration = () => {
RNBranch.validateSDKIntegration();
};
}

const validateParam = (param, paramName) => {
Expand Down

0 comments on commit d942560

Please sign in to comment.