From a5752db9852bb852e61f19dfb48a9435c1fdc79c Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Mon, 17 Jul 2023 15:20:16 +0200 Subject: [PATCH] feat(core): forward `onNewIntent` event to android plugins (#7436) --- .changes/android-on-new-intent.md | 5 +++++ core/tauri/mobile/android-codegen/TauriActivity.kt | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .changes/android-on-new-intent.md diff --git a/.changes/android-on-new-intent.md b/.changes/android-on-new-intent.md new file mode 100644 index 000000000..4164d23f7 --- /dev/null +++ b/.changes/android-on-new-intent.md @@ -0,0 +1,5 @@ +--- +"tauri": 'patch:enhance' +--- + +Listen to `onNewIntent` and forward it to registered plugins. diff --git a/core/tauri/mobile/android-codegen/TauriActivity.kt b/core/tauri/mobile/android-codegen/TauriActivity.kt index b0ca3bba8..d610116e8 100644 --- a/core/tauri/mobile/android-codegen/TauriActivity.kt +++ b/core/tauri/mobile/android-codegen/TauriActivity.kt @@ -7,6 +7,7 @@ package {{package}} import android.os.Bundle +import android.content.Intent import app.tauri.plugin.PluginManager abstract class TauriActivity : WryActivity() { @@ -18,4 +19,9 @@ abstract class TauriActivity : WryActivity() { pluginManager.onNewIntent(intent) } } + + override fun onNewIntent(intent: Intent) { + super.onNewIntent(intent) + pluginManager.onNewIntent(intent) + } }