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: 
mkdir1995
Visitor

Re: How to go back to home screen after displaying deep linking content?

I realized I should have created the screen facade INSIDE my main function, not inside my presentDeepLinkContent function. This displays my home screen on a back button press! 😄
0 Kudos
destruk
Binge Watcher

Re: How to go back to home screen after displaying deep linking content?

1 -
https://sdkdocs.roku.com/display/sdkdoc/Deep+Linking
For Movie, Episode, and Short Form yes -
Go to play the content directly. If the content is paywalled or the user is not authenticated you can redirect to the appropriate screen. The user should be able to play content directly after the required action is performed.
Meaning - if there isn't a required action except to select "Play" then they want it to start playing without the user needing to select "Play"

For Season -
Go to the episodic picker screen for this season. Select the episode who's ContentId was passed in. Do not autoplay the content.



2 - All app "Main" functions have Void return types - as that is the single function that starts the channel so it will never return anything.  The Return type is to give data back to the routine that called the function, and Main() is called by the roku Home Screen when the channel launches so it can't return anything.
What you want to do is pass the args variables for deep linking to the routine that displays your main content screen, or the poster screen, or season screen.

Rather than using presentdeepLinkContent(args) - why not simplify by sending the args to the showHomeScreen routine?

if ( args.ContentId<>Invalid ) and ( args.mediaType<>Invalid )      
PlayID=args.ContentID
MediaType=args.mediaType
else
PlayID="NONE"
MediaType="NONE"
end if 
showHomeScreen(PlayID,MediaType)


And then you would need to change your Sub showHomeScreen (if it's a sub), or Function to something like --

Function showHomeScreen(PlayID="NONE" As String,MediaType="NONE" As String)

This sets the default values for the variables to "NONE" if they aren't provided by the calling line.
0 Kudos