Roku

Roku integration

Before starting your application instrumentation, ensure that you have created an app and have an appKey

Install

Copy pyze-task.brs and pyze-task.xml into components directory

Copy pyze-roku.brs into source directory

Initialize

Add the following inside Main.brs file to initialize Pyze SDK

pyze = PyzeRokuLib(m)
pyze.initialize("YOUR_PYZE_APP_KEY")

Custom Events

Events allow you to easily track unique user actions within your app.

Event

//Get the Pyze reference
pyze = PyzeRokuLib(m)
//Post custom event
m.pyze.PostCustomEvent("Event_name")

This allows you to track when a user executed an action, for a simple count of how often that event is occurring.

Event with Attributes

Attributes are any key-value pair that you can attach to an event. You can have up to 99 attributes with any event. It is highly recommended to follow our Best Practices and heavily rely on attributes to make your instrumentation as minimal and useful as possible. In a typical application, you should have many more attributes than events.

//Pyze send event with custom attributes
pyze = PyzeRokuLib(m)
attributes = {
"color":"red",
"mode":0
}
m.pyze.PostCustomEventWithAttributes("Event_name",attributes)

In-App Notifications

In-app notifications allow app businesses to reach out to app users when they use your app. In-App notifications are built-in to the pyze sdk and have no additional dependecies.businesses to reach out to users from manually from Dynamic Funnels and Intelligence Explorer, and automatically based on workflows and campaigns from Growth Automation. In-App notifications can be sent from Campaigns

Call the following method, wherever you want to check for new messages and pop-up a modal with the notification:

- Pyze show in-app message
//To show inapp message from your Screen, import the pyze source file first.
<script type = "text/brightscript" uri = "pkg:/source/pyze-roku.brs" />
//import the pyze reference and then call the show in app message api.
pyze = PyzeRokuLib(m)
m.pyze.showInAppMessage()


Last modified 2020-12-03