Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sawood6626
Visitor

Help on Implementing New Deep Linking Requirements

I cannot seem to find any documentation on how to process deep link parameters while the channel is running as per the new requirement: 
When the channel is already running, direct playback commands will deep link to content in the channel without requiring a channel launch delay by using roInputEvent. To support this, channels must process roInputEvent the same way deep link parameters are passed through the main entry point on launch.

 I already have deep linking support on my channel and it works, however, no matter what I do the channel always re-launches when testing deep-linking. I have used both the deep linking test app and curl with the same result. Does anyone know how to properly support and test this?
0 Kudos
12 REPLIES 12
entrez
Newbie

Re: Help on Implementing New Deep Linking Requirements

Are you using the "standard" deep linking command (which includes the command to launch the channel) like this:

curl -d '' '<roku IP>:8060/launch/dev?contentID=<UUID>&mediaType=movie'

Or are you using a curl command formatted for roInput? Like this (as found here😞
curl -d '' '<roku IP>:8060/input?my_event=My%20Test&param2=100&param3=200&action=start'

The former will always (re)launch the channel because it includes a command to launch it directly in the URI. The latter is the way to send input to a roInputEvent. As far as I know the deeplinking test tool only supports the launch commands.
my public key: 234D 7C36 222E 0295
0 Kudos
sawood6626
Visitor

Re: Help on Implementing New Deep Linking Requirements

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.
0 Kudos
destruk
Binge Watcher

Re: Help on Implementing New Deep Linking Requirements

I believe relaunching the channel when a deep linking request is received is proper behavior.  When the channel relaunches, you're supposed to read the one or two variables on the request and then if possible immediately start playing the requested content. New firmware may have changed this behavior, and if it did I don't know how you'd do what they require at the moment.
0 Kudos
entrez
Newbie

Re: Help on Implementing New Deep Linking Requirements

"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
my public key: 234D 7C36 222E 0295
0 Kudos
sawood6626
Visitor

Re: Help on Implementing New Deep Linking Requirements

My code is almost identical to that; just has different names. I have successfully captured roInput events without having the channel re-launch.  It only re-launches when the input contains the "mediaType" and "contentId" fields.
0 Kudos
turtlehat
Visitor

Re: Help on Implementing New Deep Linking Requirements

I ran into this exact same issue as well. I assumed the deep links using roInputEvent wouldn't cause a relaunch but they do. I ended up testing with different var names (contentId2, mediaType2) as well to make sure my channel could deep link without relaunching.
0 Kudos
entrez
Newbie

Re: Help on Implementing New Deep Linking Requirements

What hardware and OS are you encountering this problem on?

I just tried to replicate it on five different devices, some running 8.1 and some running 8.2, and I wasn't able to do so. My channel never relaunches as long as I send the command as an input command rather than as a launch command. I am curious whether it's a hardware or a software/OS problem, because obviously this is an issue people should know about if they're struggling to comply with the new requirements and the relaunching is outside of their control somehow...
my public key: 234D 7C36 222E 0295
0 Kudos
sawood6626
Visitor

Re: Help on Implementing New Deep Linking Requirements

4400X - Roku 4
OS - 8.1.0 - build 4131-17

I'm also encountering it on my Roku Streaming Stick Plus. It's not in front of me right now, so I'll post the OS version for that one as soon as I get chance.
0 Kudos
RokuKC
Roku Employee
Roku Employee

Re: Help on Implementing New Deep Linking Requirements

"sawood6626" wrote:
I cannot seem to find any documentation on how to process deep link parameters while the channel is running as per the new requirement: 
When the channel is already running, direct playback commands will deep link to content in the channel without requiring a channel launch delay by using roInputEvent. To support this, channels must process roInputEvent the same way deep link parameters are passed through the main entry point on launch.

 I already have deep linking support on my channel and it works, however, no matter what I do the channel always re-launches when testing deep-linking. I have used both the deep linking test app and curl with the same result. Does anyone know how to properly support and test this?


Are you setting supports_input_launch=1 in your channel's manifest file?
https://sdkdocs.roku.com/display/sdkdoc ... l+Manifest

If you have that set, and you have an roInput monitor active, then sending the input command should cause your channel to receive the roInputEvent, not re-launch your channel. Note that the input command must have mediaType and contentID parameters to be recognized as a deep link event.
0 Kudos