File tree Expand file tree Collapse file tree 3 files changed +19
-14
lines changed Expand file tree Collapse file tree 3 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -127,11 +127,12 @@ You should use the following import statement on top of your `.js` file
127127import { Adjust , AdjustEvent , AdjustConfig } from ' react-native-adjust' ;
128128```
129129
130- In your ` index.android.js ` or ` index.ios .js` file, add the following code to initialize the Adjust SDK:
130+ In your ` App .js` file, add the following code to initialize the Adjust SDK:
131131
132132``` javascript
133- componentWillMount () {
134- var adjustConfig = new AdjustConfig (" {YourAppToken}" , AdjustConfig .EnvironmentSandbox );
133+ constructor (props ) {
134+ super (props);
135+ const adjustConfig = new AdjustConfig (" {YourAppToken}" , AdjustConfig .EnvironmentSandbox );
135136 Adjust .create (adjustConfig);
136137}
137138
Original file line number Diff line number Diff line change 44
55 type Props = { } ;
66 export default class App extends Component < Props > {
7- componentDidMount ( ) {
8- Linking . addEventListener ( 'url' , this . handleDeepLink ) ;
9- Linking . getInitialURL ( ) . then ( ( url ) => {
10- if ( url ) {
11- this . handleDeepLink ( { url } ) ;
12- }
13- } )
14- }
7+ constructor ( props ) {
8+ super ( props ) ;
159
16- componentWillMount ( ) {
1710 this . _onPress_trackSimpleEvent = this . _onPress_trackSimpleEvent . bind ( this ) ;
1811 this . _onPress_trackRevenueEvent = this . _onPress_trackRevenueEvent . bind ( this ) ;
1912 this . _onPress_trackCallbackEvent = this . _onPress_trackCallbackEvent . bind ( this ) ;
2922 console . log ( "Adjust SDK version: " + sdkVersion ) ;
3023 } ) ;
3124
32- var adjustConfig = new AdjustConfig ( "2fm9gkqubvpc" , AdjustConfig . EnvironmentSandbox ) ;
25+ const adjustConfig = new AdjustConfig ( "2fm9gkqubvpc" , AdjustConfig . EnvironmentSandbox ) ;
3326 adjustConfig . setLogLevel ( AdjustConfig . LogLevelVerbose ) ;
3427 adjustConfig . setShouldLaunchDeeplink ( true ) ;
3528 adjustConfig . setSendInBackground ( true ) ;
116109 // Adjust.sendFirstPackages();
117110 }
118111
112+ componentDidMount ( ) {
113+ Linking . addEventListener ( 'url ', this. handleDeepLink ) ;
114+ Linking . getInitialURL ( ) . then ( ( url ) => {
115+ if ( url ) {
116+ this . handleDeepLink ( { url } ) ;
117+ }
118+ } )
119+ }
120+
119121 componentWillUnmount ( ) {
120122 Adjust . componentWillUnmount ( ) ;
121123 Linking . removeEventListener ( 'url' , this . handleDeepLink ) ;
Original file line number Diff line number Diff line change 4040
4141 type Props = { } ;
4242 export default class App extends Component < Props > {
43- componentWillMount ( ) {
43+ constructor ( props ) {
44+ super ( props ) ;
45+
4446 var baseUrl = "" ;
4547 var gdprUrl = "" ;
4648 if ( Platform . OS === "android" ) {
You can’t perform that action at this time.
0 commit comments