Forum Discussion
entrez
7 years agoNewbie
"sawood6626" wrote:
I've tried using both the input and the launch commands. The input command causes the channel to relaunch when the mediatype and contentid parameters are present.
Can you post some snippets of your code that deals with a roInputEvent? I don't understand why an input event would cause your channel to relaunch unless it has to do with the way it's structured. If it helps, I can show you the code I added (really only a handful of lines difference) in order to deal with roInputEvents, in comparison to the code that deals with "standard" deep linking. I don't know how "right" this is, but it does work and the channel doesn't relaunch when I send a curl command with "input" rather than "launch."
Sub Main(args as Dynamic)
screen = CreateObject("roSGScreen")
m.scene = screen.CreateScene("HomeScene")
port = CreateObject("roMessagePort")
input = CreateObject("roInput") # THIS LINE IS NEW
screen.SetMessagePort(port)
input.SetMessagePort(port) # THIS LINE IS NEW
screen.Show()
...
if args.ContentID <> invalid and args.MediaType <> invalid
? "[Main] Processing deeplink..."
ProcessDeepLink(args)
end if
while(true)
msg = wait(0, port)
? "msg = " + msg
if type(msg) = "roInputEvent" and msg.isInput() then # THIS BLOCK IS NEW
if msg.GetInfo().MediaType <> invalid and msg.GetInfo().ContentID <> invalid
ProcessDeepLink(msg.GetInfo())
end if
end if
...
end while
...
End Sub