From e90e71d151ae1839b2ad3c8d3e2b217f8d0cb645 Mon Sep 17 00:00:00 2001 From: evlist Date: Wed, 14 Dec 2022 21:50:09 +0100 Subject: [PATCH] Testing Android intents as a receiver. --- AndroidManifest.xml | 7 +++++++ package-lock.json | 19 +++++++++++++++++++ package.json | 2 ++ src/App.tsx | 23 +++++++++++++++++++++++ 4 files changed, 51 insertions(+) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 860b16b..ec0a0df 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -26,6 +26,13 @@ + + + + + + + AndroidFullScreen.immersiveMode()) .catch(console.warn); +if (window.plugins) { + window.plugins.intentShim.registerBroadcastReceiver( + { + filterActions: ['android.intent.action.VIEW'], + }, + function (intent: any) { + console.log({ + caller: 'Intent broadcast receiver', + intent, + }); + } + ); + window.plugins.intentShim.onIntent(function (intent: any) { + console.log({ caller: 'Intent receiver', intent }); + }); +} else { + console.log({ + caller: 'Intent', + message: "window.plugins doesn't exist", + window, + }); +} + const App: Component = () => { return (