mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-01 12:08:06 +02:00
feat(template): add mobile projects, build script, fill initial src code (#305)
This commit is contained in:
committed by
GitHub
parent
0fed10fdce
commit
775581d824
@@ -0,0 +1,19 @@
|
||||
package {{android_package_id}}
|
||||
|
||||
import android.app.Activity
|
||||
import app.tauri.annotation.Command
|
||||
import app.tauri.annotation.TauriPlugin
|
||||
import app.tauri.plugin.JSObject
|
||||
import app.tauri.plugin.Plugin
|
||||
import app.tauri.plugin.Invoke
|
||||
|
||||
@TauriPlugin
|
||||
class ExamplePlugin(private val activity: Activity): Plugin(activity) {
|
||||
@Command
|
||||
fun ping(invoke: Invoke) {
|
||||
val value = invoke.getString("value") ?: ""
|
||||
val ret = JSObject()
|
||||
ret.put("value", value)
|
||||
invoke.resolve(ret)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user