Roku

The Roku SDK supports programmatic experimentation (Dynamic Variables and Code Blocks) as well as Feature Flags.

SDK Installation and Initialization

Sign in to the Apptimize dashboard. You’ll see a welcome page that asks for the name of your app. After entering all your info, you’ll see these installation instructions again.

  1. Download the latest Roku SDK from the SDK Download page.
  2. Drag the files into your project.
  3. Add the following snippet to the XML file of the main screen component using the API Token associated with your app, which can be found in the Install tab of your Dashboard. Note this is different than the App Key used for other platforms.
Roku
<Apptimize
    id="apptimize"
    apiToken="<APIToken>"
    appName="<AppName>"
    appVersion="<AppVersion>"
    logLevel="<VERBOSE|DEBUG|INFO|WARN|ERROR|NONE>" />
  1. Add the following snippet to the BrightScript file of the main screen component.
Roku
m.apptimize = m.top.findNode("Apptimize")
m.apptimize.observeField("content", "setcontent") //handles the results of each request

function setcontent(message as Object)
    apptimizeResponse = message.getData()
    ?apptimizeResponse.id 'id returned by each api request
    ?apptimizeResponse.success
    ?apptimizeResponse.response 'data returned by the request
end function
  1. You should now have access to all Apptimize APIs.