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.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Channel Surfer

Best practice for targeting firmware, want to use <function> interface

Hello all,
I am working on a SceneGraph library that will be used in several apps to provide CMS, entitlement, advertising, and metrics to channel developers. This is a port from SDK1 to SG.
I am using to the <function> interface to expose my API. 
Is there any reason not to design an app this way? I see that <function> requires firmware 7.5, is it a bad idea to require a recent firmware version when our apps are intended for as wide an audience as possible?

For some background, these functions do not have return values, mostly they trigger Task nodes hidden away in my library. I am relying on the field observer model to provide responses for any function calls.
I like the idea of functions because they are familiar to developers coming from any other language that isn't Roku SceneGraph, and therefore they don't have to use the arcane Task 'control' field API to trigger my library's HTTP calls and the like.

For example, with the function node in play:

sub someFunction()
    genius_library ="my_genius_library")
    genius_library.callFunc("loadConfiguration", params)
end sub

sub OnConfigLoaded(obj)
    ? "OnConfigLoaded"
end sub

If I don't take advantage of the <function> in order to target older firmware, thens devs are required to jump through more hoops to do the same thing:
sub someFunction()
    genius_library ="my_genius_library") 
    config_loader = m.genius_library.findNode("config_loader")
   config_loader.control = "RUN"
end sub

sub OnConfigLoaded(obj)
    ? "OnConfigLoaded"
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.