File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ class App extends React.Component<any, MyState> {
4747 data : BranchButton [ ] ;
4848 events : BranchButton [ ] ;
4949 sections : BranchSection [ ] ;
50+ testing : BranchButton [ ] ;
5051
5152 constructor ( props : any ) {
5253 super ( props ) ;
@@ -154,10 +155,19 @@ class App extends React.Component<any, MyState> {
154155 } ,
155156 ] ;
156157
158+ this . testing = [
159+ {
160+ text : 'Validate SDK Integration' ,
161+ onPress : this . branchWrapper . validateSDKIntegration . bind ( this ) ,
162+ image : require ( './images/attach_money_FILL1_wght400_GRAD0_opsz48.png' ) ,
163+ }
164+ ] ;
165+
157166 this . sections = [
158167 { sectionName : 'Linking' , branchButtons : this . linking } ,
159168 { sectionName : 'Data' , branchButtons : this . data } ,
160169 { sectionName : 'Events' , branchButtons : this . events } ,
170+ { sectionName : 'Testing' , branchButtons : this . testing } ,
161171 ] ;
162172 }
163173
Original file line number Diff line number Diff line change @@ -185,6 +185,15 @@ export default class BranchWrapper {
185185 branch . logout ( ) ;
186186 } ;
187187
188+ validateSDKIntegration = async ( ) => {
189+ const packageJson = require ( '../package.json' ) ;
190+ const sdkVersion = packageJson . dependencies [ 'react-native-branch' ] ;
191+
192+ Alert . alert ( 'Branch Integration Validator' ,
193+ 'Branch SDK Version: ' + sdkVersion ,
194+ [ { text : 'OK' , onPress : ( ) => console . log ( 'OK Pressed' ) } , ] ) ;
195+ } ;
196+
188197 viewFirstReferringParams = async ( ) => {
189198 let params = await branch . getFirstReferringParams ( ) ;
190199 this . createAlert ( 'Install referring params' , JSON . stringify ( params ) ) ;
Original file line number Diff line number Diff line change @@ -348,6 +348,7 @@ interface Branch {
348348 setPreInstallCampaign : ( campaign : string ) => void ;
349349 setPreInstallPartner : ( partner : string ) => void ;
350350 setDMAParamsForEEA : ( eeaRegion : boolean , adPersonalizationConsent : boolean , adUserDataUsageConsent : boolean ) => void ;
351+ validateSDKIntegration : ( ) => void ;
351352}
352353declare const branch : Branch ;
353354export default branch ;
Original file line number Diff line number Diff line change @@ -138,6 +138,8 @@ class Branch {
138138 ) ;
139139 } ;
140140
141+ validateSDKIntegration = ( ) => { } ;
142+
141143 /*** PreInstall Parameters ***/
142144 setPreInstallCampaign = ( campaign ) =>
143145 RNBranch . setPreinstallCampaign ( campaign ) ;
You can’t perform that action at this time.
0 commit comments