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: 
ddmorin
Channel Surfer

Do you have to enable or allow Deep Linking?

Jump to solution

So I'm in the process of recreating my channel that used to be Direct Publisher, and so far it's going great. I have my feed being read correctly and managed by a grid, with video play back.  Great.  Then I find out I have to implement Deep Linking.

I'm directly using the example code out of scenegraph-master-sample/DeepLinking, but I need some help debugging.  I try to curl into my site as described in the docs, and it always just drops me on my main screen.

If I try dropping breadcrumbs in the main.brs, it looks like nothing ever comes back from my "wait" function:

 

? "Starting Event Loop"
while(true)
' waiting for events from screen
? "Waiting"
? m
msg = wait(0, m.port)
? "msg="
? msg
msgType = type(msg)
...

So in code like this snippet I'd see "Starting Event Loop", then "Waiting" and a dump of the m variable...but then, nothing.  I run the curl, the app basically just starts over and spits out the same things.  I never see "msg=".

Am I misunderstanding how that wait function works? I would think that maybe my app is terminated prematurely, but there's no output to that effect and it doesn't ever show any of my fallthrough breadcrumbs, either.

In the manifest I have supports_input_launch=1. Is there anything else at the app level I needed to updateto get input events flowing?  I'll note that my app continues to work -- I can browse the grid and continue to play videos just fine.  

 

0 Kudos
1 Solution

Accepted Solutions
renojim
Community Streaming Expert

Re: Do you have to enable or allow Deep Linking?

Jump to solution

Is m.port assigned to the roInput object you created?  In that example, the pertinent lines are:

 

m.port = CreateObject("roMessagePort")
inputObject=createobject("roInput")
inputObject.setmessageport(m.port)

 

 

I haven't tried to run the example as is, but I can execute the lines in the debugger:

 

Brightscript Debugger> inputObject=createobject("roInput")
Brightscript Debugger> port = CreateObject("roMessagePort")
Brightscript Debugger> inputObject.setmessageport(port)
Brightscript Debugger> msg=wait(0,port)

 

 

Then I execute the curl command:

 

curl -d "" "http://192.168.0.191:8060/input/dev?contentId=1234&mediaType=movie"

 

 

Result:

 

Brightscript Debugger> ?msg.getinfo()
<Component: roAssociativeArray> =
{
    contentId: "1234"
    mediaType: "movie"
    source_ip_addr: "192.168.0.118"
}

 

If you have all of the pieces and you're not getting the wait to return I would suspect something about the curl command.

 

 

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.

View solution in original post

0 Kudos
4 REPLIES 4
renojim
Community Streaming Expert

Re: Do you have to enable or allow Deep Linking?

Jump to solution

"I try to curl into my site"?   What do you mean by that?  You should be using the Roku device's IP address in the curl.  Is this the example you're following?

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
ddmorin
Channel Surfer

Re: Do you have to enable or allow Deep Linking?

Jump to solution

Yes, I'm curling into the IP of my device, sorry for the confusion. And that is the correct example that I've been using.  I guess my question put another way is, if I were to trace or breadcrumb that entire example, and then execute that curl command, what's the flow? What happens after we hit that wait() statement? Because it seems like I'm just getting a dead end and I'm not sure how to proceed.

0 Kudos
renojim
Community Streaming Expert

Re: Do you have to enable or allow Deep Linking?

Jump to solution

Is m.port assigned to the roInput object you created?  In that example, the pertinent lines are:

 

m.port = CreateObject("roMessagePort")
inputObject=createobject("roInput")
inputObject.setmessageport(m.port)

 

 

I haven't tried to run the example as is, but I can execute the lines in the debugger:

 

Brightscript Debugger> inputObject=createobject("roInput")
Brightscript Debugger> port = CreateObject("roMessagePort")
Brightscript Debugger> inputObject.setmessageport(port)
Brightscript Debugger> msg=wait(0,port)

 

 

Then I execute the curl command:

 

curl -d "" "http://192.168.0.191:8060/input/dev?contentId=1234&mediaType=movie"

 

 

Result:

 

Brightscript Debugger> ?msg.getinfo()
<Component: roAssociativeArray> =
{
    contentId: "1234"
    mediaType: "movie"
    source_ip_addr: "192.168.0.118"
}

 

If you have all of the pieces and you're not getting the wait to return I would suspect something about the curl command.

 

 

Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
ddmorin
Channel Surfer

Re: Do you have to enable or allow Deep Linking?

Jump to solution

Thank you for the patient steps.  Turns out my problem was that case sensitivity was getting in my way in places I did not see -- I was passing in curl params like MediaType and contentID, while the code is all pretty specific to mediaType and contentId. This (among other things) was causing a lot of my comparison logic to fail. But once I unwound it I started making some real progress.

 

0 Kudos