Browse Source

feat(core): forward `onNewIntent` event to android plugins (#7436)

Fabian-Lars 2 years ago
parent
commit
a5752db985

+ 5 - 0
.changes/android-on-new-intent.md

@@ -0,0 +1,5 @@
+---
+"tauri": 'patch:enhance'
+---
+
+Listen to `onNewIntent` and forward it to registered plugins.

+ 6 - 0
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)
+  }
 }