Channels are now required to support roInput events. Please opt in to this support with the supports_input_launch=1 manifest entry and properly handle roInput events in your channel.
sub main(args as dynamic)
m.port = CreateObject("roMessagePort")
screen = CreateObject("roSGScreen")
screen.setMessagePort(m.port)
m.global = screen.getGlobalNode()
m.global.id = "GlobalNode"
input = CreateObject("roInput")
input.setMessagePort(m.port)
scene = screen.CreateScene("MainScene")
scene.backExitsScene = false
m.global.addFields({
screen: screen
})
screen.show()
while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSpringboardScreenEvent" then
if msgType = "roSGScreenEvent"
if msg.isScreenClosed() then return
end if
end if
if msgType = "roInputEvent"
info = msg.getInfo()
print info
end if
end while
end sub
i have the same problem can you help me please
this main.brs works:
' first thing that happens in a channel'
sub main()
msgPort = CreateObject("roMessagePort")
input = CreateObject("roInput")
input.SetMessagePort(msgPort)
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("MainScene")
scene.signalBeacon("AppLaunchComplete")
screen.show()
while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed() then return
end if
if msgType = "roInputEvent"
info = msg.getInfo()
'info is now just like args passed to your Main() method
'it contains mediaType and contentId properties, so you
'can use your normal deep-link handling code
getDeepLink(info)
end if
end while
end sub
Function getDeepLinks(args) as Object
deeplink = Invalid
if args.contentid <> Invalid and args.mediaType <> Invalid
deeplink = {
id: args.contentId
type: args.mediaType
}
end if
return deeplink
end Function
Hey, I'm encountering this problem too and I tried the code in the last comment with no success, static analysis still fails. Did anyone find the actual cause of the problem? (yes, I have the flag set in manifest)