diff --git a/tsconfig.json b/tsconfig.json index fc3fe53..813db23 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,4 +20,4 @@ "node_modules", "bundles" ] -} +} \ No newline at end of file diff --git a/urlhandler.android.ts b/urlhandler.android.ts index 7dfa469..9ea3587 100644 --- a/urlhandler.android.ts +++ b/urlhandler.android.ts @@ -7,7 +7,7 @@ let lastReceivedData = null; export function handleIntent(intent: any) { let data = intent.getData(); - if (data !== lastReceivedData) { + if (data.toString() !== lastReceivedData.toString()) { try { if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) { application.android.on(application.AndroidApplication.activityResultEvent, (eventData) => { @@ -22,29 +22,24 @@ export function handleIntent(intent: any) { } } application.android.on(application.AndroidApplication.activityCreatedEvent, (args) => { - let intent: android.content.Intent = args.activity.getIntent(), - data = intent.getData(); - if (data !== lastReceivedData) { - try { - if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) { - handleIntent(intent); - } - } catch (e) { - console.error('Unknown error during getting App URL data', e); + let intent: android.content.Intent = args.activity.getIntent(); + try { + if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) { + handleIntent(intent); } + } catch (e) { + console.error('Unknown error during getting App URL data', e); } + }); application.android.on(application.AndroidApplication.activityResumedEvent, (args) => { - let intent: android.content.Intent = args.activity.getIntent(), - data = intent.getData(); - if (data !== lastReceivedData) { - try { - if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) { - handleIntent(intent); - lastReceivedData = data; - } - } catch (e) { - console.error('Unknown error during getting App URL data', e); + let intent: android.content.Intent = args.activity.getIntent(); + try { + if (new String(intent.getAction()).valueOf() === new String(android.content.Intent.ACTION_VIEW).valueOf()) { + handleIntent(intent); + lastReceivedData = intent.getData(); } + } catch (e) { + console.error('Unknown error during getting App URL data', e); } });