mirror of
https://github.com/SnapEnhance/scripting-docs.git
synced 2026-08-30 20:24:23 +00:00
feat: examples
This commit is contained in:
17
examples/simple_ipc.js
Normal file
17
examples/simple_ipc.js
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user