add new APIs

This commit is contained in:
Evgeny
2022-12-29 11:45:20 +04:00
parent 5f40ef4962
commit e76d17b5de
5 changed files with 32 additions and 7 deletions

View File

@@ -0,0 +1,6 @@
-- name = "Command receiver"
-- type = "search"
function on_command(value)
search:show{value}
end

View File

@@ -1,4 +1,4 @@
function on_resume()
local location = system:get_location()
local location = system:location()
ui:show_text(location[1].." "..location[2])
end

View File

@@ -0,0 +1,16 @@
function on_resume()
ui:show_text("Tap to request location")
end
function on_click()
system:request_location()
ui:show_text("Loading...")
end
function on_location_result(location)
if location ~= nil then
ui:show_text(location[1].." "..location[2])
else
ui:show_text("Error")
end
end

View File

@@ -1,8 +1,8 @@
function on_resume()
ui:show_lines{
"send text",
"send 123",
"send table",
"send text to msg-receiver.lua script",
"send 123 to all",
"send table to all",
}
end
@@ -10,7 +10,7 @@ function on_click(idx)
if idx == 1 then
aio:send_message("text", "msg-receiver.lua")
elseif idx == 2 then
aio:send_message(1)
aio:send_message(123)
else
aio:send_message{ "one", "two", "three" }
end