matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018
05:51 AM
Help with Deep Linking
Hi Gang, looking for some help on enabling Deep Linking with a channel;
https://github.com/rokudev/videoplayer-channel
Apparently the code is in there but just not enabled so I was wondering what code I have to change in there to enable Deep Linking and do I then only need to add contentid and mediaType in the Stream XML file which I have done already like mentioned here;
https://sdkdocs.roku.com/display/sdkdoc/Deep+Linking but not sure if that is all that has to be done?
Thank you
https://github.com/rokudev/videoplayer-channel
Apparently the code is in there but just not enabled so I was wondering what code I have to change in there to enable Deep Linking and do I then only need to add contentid and mediaType in the Stream XML file which I have done already like mentioned here;
https://sdkdocs.roku.com/display/sdkdoc/Deep+Linking but not sure if that is all that has to be done?
Thank you
5 REPLIES 5
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018
12:03 PM
Re: Help with Deep Linking
I assume you're aware but in case not, you can test it out using the tools Roku provides here: https://devtools.web.roku.com/#deep-linking-tool-link
aspiring
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2018
12:41 PM
Re: Help with Deep Linking
Hi Joe, okay I'll use that to test it but what do I have to enable in the channel code to enable Deep Linking?
At the bottom of that channel page it says;
Warning
This sample does not utilize deep-linking and warning dialog messages but has them in the code if a developer desires to use them.
So I'm looking for someone to show me what I need to change in the code to enable it then I can test it. Thanks
At the bottom of that channel page it says;
Warning
So I'm looking for someone to show me what I need to change in the code to enable it then I can test it. Thanks
joetesta
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2018
05:08 PM
Re: Help with Deep Linking
In your application's main.brs file you should have the first line:
When the app has been called via deeplink, the params (contentId, mediaType) will be passed in that params field and in your main.brs, you generally set fields on global
and then later in your app you check if those fields are present, navigate or play accordingly while clearing the fields.
Hope it may help,
Joe
sub main(params = {} as object)
When the app has been called via deeplink, the params (contentId, mediaType) will be passed in that params field and in your main.brs, you generally set fields on global
if params.contentId <> invalid
... set global fields ..
and then later in your app you check if those fields are present, navigate or play accordingly while clearing the fields.
Hope it may help,
Joe
aspiring
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2018
01:35 PM
Re: Help with Deep Linking
Hi Joe, here is the main.brs. Is it currently setup correctly? I don't see mediaType. Are contentId and mediaType called here?
contentID is in UriHandler.brs but what do I have to enable to get this to work? I have the contentId and mediaType in my stream xml file so I just need help turning DL On in the channel code. Thanks
contentID is in UriHandler.brs but what do I have to enable to get this to work? I have the contentId and mediaType in my stream xml file so I just need help turning DL On in the channel code. Thanks
' ********** Copyright 2016 Roku Corp. All Rights Reserved. **********
' 1st function called when channel application starts.
sub Main(input as Dynamic)
print "################"
print "Start of Channel"
print "################"
' Add deep linking support here. Input is an associative array containing
' parameters that the client defines. Examples include "options, contentID, etc."
' See guide here: https://sdkdocs.roku.com/display/sdkdoc/External+Control+Guide
' For example, if a user clicks on an ad for a movie that your app provides,
' you will have mapped that movie to a contentID and you can parse that ID
' out from the input parameter here.
' Call the service provider API to look up
' the content details, or right data from feed for id
if input <> invalid
print "Received Input -- write code here to check it!"
if input.reason <> invalid
if input.reason = "ad" then
print "Channel launched from ad click"
'do ad stuff here
end if
end if
if input.contentID <> invalid
m.contentID = input.contentID
print "contentID is: " + input.contentID
'launch/prep the content mapped to the contentID here
end if
end if
showHeroScreen(input)
end sub
' Initializes the scene and shows the main homepage.
' Handles closing of the channel.
sub showHeroScreen(input as object)
print "main.brs - [showHeroScreen]"
screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.CreateScene("VideoScene")
m.global = screen.getGlobalNode()
'Deep link params
m.global.addFields({ input: input })
screen.show()
while(true)
msg = wait(0, m.port)
msgType = type(msg)
if msgType = "roSGScreenEvent"
if msg.isScreenClosed() then return
end if
end while
end sub
matrixebiz
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2018
08:07 PM
Re: Help with Deep Linking
Hi All, just wondering if I can get some more help here so we can close one thread to completion 🙂 Thanks