Nonstop Brightscript SDK

Getting Task Details

There are some scenarios where the containing Client needs to know what is on offer to the user for completing a given task.

The main example of this is in order to present the correct information to logged out users in marketing scenarios such as on-boarding.

The Client application can call Nonstop with a given task type:

    sub GetTaskDetails()
        promise = m.global.Nonstop.instance.callFunc("getTaskDetails", {
            taskName: "sign-up"
        })
        promise.observeField("data", "OnTaskDetailsResult")
    end sub

    sub OnTaskDetailsResult(message as Object)
        promise = message.getRoSGNode()
        if promise.status = 1 then
            ' Check promise.data.body for details of the task
        else if promise.status = 2 then
            ' something went wrong
        end if
        promise.unObserveFieldScoped("data")
    end sub

In this case promise.data.body response has the following properties:

  • pointsAvailable: Int - The number of points the user would receive for completing that Task
  • pointsAvailableDisplay: String - The number of points the user would receive for completing that Task, correctly formatted for display to the user.
In this document