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.