Testing Android intents as a receiver.
This commit is contained in:
1 parent
b797015c57
commit
e90e71d151
4 files changed
+51
No files matched your search
+23
@@ -8,6 +8,29 @@ AndroidFullScreen.isImmersiveModeSupported()
|
||||
.then(() => 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 (
|
||||
<Routes>
|
||||
|
||||
Reference in new issue
Block a user