Skip to content

Commit

Permalink
Got android package name displaying on IntegrationValidator popup
Browse files Browse the repository at this point in the history
Got android package name displaying on IntegrationValidator popup
  • Loading branch information
rob-gioia-branch committed Oct 4, 2024
1 parent cb94bd3 commit 2d3ecec
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.util.List;
import io.branch.rnbranch.RNBranchModule;


public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost =
Expand Down
2 changes: 2 additions & 0 deletions branchreactnativetestbed/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ 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')
include ':react-native-version-check'
project(':react-native-version-check').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-check/android')
7 changes: 5 additions & 2 deletions branchreactnativetestbed/components/AndroidValidator.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

import VersionCheck from 'react-native-version-check';

export default class AndroidValidator {
static checkAndroidInitialization() {
//check that the native layer components initialized successfully for Android
Expand All @@ -7,8 +10,8 @@ export default class AndroidValidator {
//check that the Branch keys are present in the AndroidManifest file
}

static checkPackageName() {
//check if the package name of the app matches the one from the dashboard
static getPackageName() {
return VersionCheck.getPackageName()
}

static checkURIScheme() {
Expand Down
5 changes: 4 additions & 1 deletion branchreactnativetestbed/components/IntegrationValidator.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Alert } from 'react-native';
import AndroidValidator from './AndroidValidator';

export default class IntegrationValidator {
static getBranchSDKVersion() {
Expand All @@ -15,7 +16,9 @@ export default class IntegrationValidator {

static validate() {
Alert.alert('Branch Integration Validator',
'Branch SDK Version: ' + IntegrationValidator.getBranchSDKVersion(),
'Branch SDK Version: ' + IntegrationValidator.getBranchSDKVersion() + "\n\n" +
'Android:\n' +
'\t\t• Package Name: ' + AndroidValidator.getPackageName(),
[{text: 'OK', onPress: () => console.log('OK Pressed')},]);
}

Expand Down
75 changes: 68 additions & 7 deletions branchreactnativetestbed/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion branchreactnativetestbed/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"dependencies": {
"react": "18.2.0",
"react-native": "0.72.5",
"react-native-branch": "6.3.0"
"react-native-branch": "6.3.0",
"react-native-version-check": "^3.4.7"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down

0 comments on commit 2d3ecec

Please sign in to comment.