Nonstop Brightscript SDK

Nonstop Home

Nonstop Home can be opened by calling:

    m.global.Nonstop.nonstopHome.callFunc("presentNonstopHome", {
        ComponentController: m.top.getScene().ComponentController
    })

This will open the Nonstop Home experience which is full managed by the SDK.

Deeplinking

By default Nonstop Home opens on the Earn tab. To open it on another tab, pass the name of the tab as a string as the tab parameter to the presentNonstopHome method:

    m.global.Nonstop.nonstopHome.callFunc("presentNonstopHome", {
        ComponentController: m.top.getScene().ComponentController
        tab: "HowItWorks"
    })

Valid values for tab are Earn, HowItWorks, RedeemCode and History

Additionally, for certain deeplinks it may be necessary to open Nonstop Home at a particular promo. In this case, pass an instance of the NonstopHomeAction node to the presentNonstopHome method as the action parameter:

sub OnPresentPromo()
    currentCC = m.top.getScene().ComponentController
    promoAction = createNodeAndInit("NonstopHomeAction", {
        type: "open-promo"
        contentId: "cdccd872-60bf-4ff5-d7bc-08d67806f594"
    })
    m.global.Nonstop.nonstopHome.callFunc("presentNonstopHome", {
        ComponentController: m.top.getScene().ComponentController
        action: promoAction
    })
end sub

function createNodeAndInit(nodeName as string, params = invalid as Object)
    node = createObject("roSGNode", nodeName)
    if params <> invalid then
        node.setFields(params)
    end if
    return node
end function

At the moment, the only supported action has a type of open-promo and requires a contentId to be passed.

History Widget

The history items from Nonstop Home History can be rendered as a separate widget for including in other areas of the app. The widget will require a logged in Nonstop User.

How To Use

<NonstopHistoryView
    id="historyView"
    visible="true"
    translation="[0,0]"/>

Customize in Brightscript:

    m.pointsWidget = m.top.findNode("historyView")
    m.pointsWidget.itemCount = 4

Additional Attributes

  • itemCount - (Default value: 5) Determines how many items will be rendered in the view
In this document