feat: examples

This commit is contained in:
rhunk
2023-12-24 18:06:00 +01:00
committed by GitHub
parent 34e032f9db
commit 38dada3ed0
3 changed files with 71 additions and 0 deletions

17
examples/simple_ipc.js Normal file
View File

@@ -0,0 +1,17 @@
// ==SE_module==
// name: IPC Test
// version: 1.0
// author: John Doe
// ==/SE_module==
var ipc = require("ipc")
module.onSnapEnhanceLoad = context => {
ipc.on("myEvent", (args) => {
longToast("received event: " + args)
})
}
module.onSnapMainActivityCreate = activity => {
ipc.emit("myEvent", "hello", 255, activity.packageName)
}