@@ -9,31 +9,26 @@ export function handleIntent(intent: any) {
99 let data = intent . getData ( ) ;
1010 if ( lastReceivedData === null || data . toString ( ) !== lastReceivedData . toString ( ) ) {
1111 try {
12- if ( new String ( intent . getAction ( ) ) . valueOf ( ) === new String ( android . content . Intent . ACTION_VIEW ) . valueOf ( ) ) {
12+ if ( new String ( intent . getAction ( ) ) . valueOf ( ) === new String ( android . content . Intent . ACTION_MAIN ) . valueOf ( )
13+ || new String ( intent . getAction ( ) ) . valueOf ( ) === new String ( android . content . Intent . ACTION_VIEW ) . valueOf ( ) ) {
1314 try {
14- setTimeout ( ( ) => {
15- getCallback ( ) ( extractAppURL ( data ) ) ;
16- } ) ;
15+ setTimeout ( ( ) => getCallback ( ) ( extractAppURL ( data ) ) ) ;
1716 } catch ( ignored ) {
1817 application . android . on ( application . AndroidApplication . activityResultEvent , ( eventData ) => {
19- setTimeout ( ( ) => {
20- getCallback ( ) ( extractAppURL ( data ) ) ;
21- } ) ;
18+ setTimeout ( ( ) => getCallback ( ) ( extractAppURL ( data ) ) ) ;
2219 } ) ;
2320 }
2421 }
2522 } catch ( e ) {
2623 console . error ( 'Unknown error during getting App URL data' , e ) ;
2724 }
25+ lastReceivedData = data ;
2826 }
2927}
3028application . android . on ( application . AndroidApplication . activityCreatedEvent , ( args ) => {
3129 let intent : android . content . Intent = args . activity . getIntent ( ) ;
3230 try {
33- if ( new String ( intent . getAction ( ) ) . valueOf ( ) === new String ( android . content . Intent . ACTION_MAIN ) . valueOf ( )
34- || new String ( intent . getAction ( ) ) . valueOf ( ) === new String ( android . content . Intent . ACTION_VIEW ) . valueOf ( ) ) {
35- handleIntent ( intent ) ;
36- }
31+ handleIntent ( intent ) ;
3732 } catch ( e ) {
3833 console . error ( 'Unknown error during getting App URL data' , e ) ;
3934 }
@@ -42,11 +37,7 @@ application.android.on(application.AndroidApplication.activityCreatedEvent, (arg
4237application . android . on ( application . AndroidApplication . activityResumedEvent , ( args ) => {
4338 let intent : android . content . Intent = args . activity . getIntent ( ) ;
4439 try {
45- if ( new String ( intent . getAction ( ) ) . valueOf ( ) === new String ( android . content . Intent . ACTION_MAIN ) . valueOf ( )
46- || new String ( intent . getAction ( ) ) . valueOf ( ) === new String ( android . content . Intent . ACTION_VIEW ) . valueOf ( ) ) {
47- handleIntent ( intent ) ;
48- lastReceivedData = intent . getData ( ) ;
49- }
40+ handleIntent ( intent ) ;
5041 } catch ( e ) {
5142 console . error ( 'Unknown error during getting App URL data' , e ) ;
5243 }
0 commit comments