Reward Actions

Reward Action are used to trigger the reward engine for the given action. There are already built in reward actions already defined in producer suite where producer/integrators could also create their own custom reward actions.

Some example of custom reward actions could be:

  1. Opening an app once a day
  2. Completing an on-boarding process
  3. Reading an article
  4. Watching a video

Creating a Custom Reward Action

  1. In producer suite, browse to the "Rewards" section from the left navigation panel.
  2. Click on Actions tab which will show you list of all available reward actions.
  3. Click on "New Reward Action" button, fill in the required details and click "Create".

List of all Reward Actions

Get list of all reward actions. Each list item is a reward action object that contains a "key" property which could be used to fetch invoked reward actions for a given program id.

LiveLike.getRewardActions().then(({results}) => console.log(results))
sdk.rewards().getRewardActions(
                LiveLikePagination.FIRST,
                object : LiveLikeCallback<LLPaginatedResult<RewardActionInfo>>() {
                    override fun onResponse(
                        result: LLPaginatedResult<RewardActionInfo>?,
                        error: String?
                    ) {
                       Log.d("result",result)
                    }
                })
self.sdk.rewards.getRewardActions(
    page: .first
) { result in
    switch result {
  case .failure(let error):
    //Failure Block
    case .success(let rewardActions):
    //Success Block
    }
}

List of all invoked Reward actions

Get list all the invoked reward actions for a given program. You could also filter the reward actions by passing a list of reward action keys.

LiveLike.getInvokedRewardActions({
  programId: "xxx-yyy-zzz"
}).then(({results}) => console.log(results))
sdk.rewards().getInvokedRewardActions(
                LiveLikePagination.FIRST,
                invokedActionRequestParams = GetInvokedRewardActionParams("xxx-yyy-zzz",rewardActionKeys)
                , object : LiveLikeCallback<LLPaginatedResult<InvokedRewardAction>>() {
                    override fun onResponse(
                        result: LLPaginatedResult<InvokedRewardAction>?,
                        error: String?
                    ) {
                         Log.d("result",result)
                    }
                })
self.sdk.rewards.getInvokedRewardActions(
    page: .first,
    options: GetInvokedRewardActionsOptions(
        programID: programID,
        rewardActionKeys: rewardActionKeys
    )
) { result in
    switch result {
    case .failure(let error):
    //Failure Block
  case .success(let invokedActions):
    //Success Block
    }
}