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: 
Alexander1
Newbie

Deeplinking with Json to pass certification

Hi all, I am sort of new to Roku development.
I am working on developing my second channel.

I initially got a demo working and certified in September, but recently I found out that the Deeplinking requirements have changed.

I am using the Video Player sample with a JSON feed file and cannot figure out how to get the deeplinking working.

I have cross-referenced the deeplinking sample channel, but it works with an xml feed file so I can't compare exactly.

I don't plan on implementing a roku search feed to make use of the deeplinking, I just need it to pass certification.

Thanks in advance for any help.

0 Kudos
1 REPLY 1
cocotower
Roku Guru

Re: Deeplinking with Json to pass certification

Remember that there is no reason to supply DeepLink parameters to every video in your grid.  I always supply ONE DeepLink to a very short video during the channel submission/update process, then if I think about it after Roku publishes the latest channel version, I change the supplied MediaID of the video in my feed.

In my main.brs I grab the DeepLink params passed into my channel (mediaID, etc.) then from heroScene.brs sometime just after the video grid is shown, I simulate a user Click to the DeepLinked MediaID.  I handle any paid content just as if a user clicked on it, so there is no Deep Linking to Paid Content without going through the Please Subscribe process.  Just before the DeepLinked video plays, set the DeepLink flag to false.  I'm sure that Roku's examples don't consider the Subscription Content concerns with DeepLinking which is down right terrifying to me. 

How you implement all of this depends on your BrightScript skills, but it's ultimately up to you as the channel owner.  You do not have to use the online examples letter for letter.  For security reasons, you have every right to be as creative and careful as you like.

 

sub Main(args as Dynamic) as Void

print "################"
print "Start of Channel"
print "################"

print "main.brs"

m.screen = CreateObject("roSGScreen")
m.port = CreateObject("roMessagePort")
m.screen.setMessagePort(m.port)
Setup(args)
MakeScene()

while(true)
msg = wait(0, m.port)
msgType = type(msg)
print msgType
print msg
if msgType = "roSGScreenEvent"
if msg.isScreenClosed() then return
' else if msgType = "roSGNodeEvent"
' if msg.GetField() = "RestartChannel"
' if msg.GetData() = "yes"
' print "restarting"
' m.scene.Close()
' MakeScene()
' Setup(args)
' end if
' end if
end if

end while


end sub

sub MakeScene()
m.scene = m.screen.CreateScene("heroScene")
m.scene.signalBeacon("AppDialogInitiate")
m.screen.show()
m.scene.signalBeacon("AppDialogComplete")
m.scene.signalBeacon("AppLaunchComplete")

end sub

sub Setup(args as Dynamic) as Void
m.global = m.screen.getGlobalNode()
m.global.id = "GlobalNode"

'DeepLinking
if args.contentID <> invalid AND args.mediaType <> invalid
m.global.addFields( {contentDLId: args.contentID} )
m.global.addFields( {mediaDPType: args.mediaType} )
m.global.addFields( {deepLinkingLand: true} )
else
m.global.addFields( {deepLinkingLand: false} )
end if

end sub

 

0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.