Rewards

Handles Rewards related requests with IMS web services.

The SDK allows for the host application to retrieve a token, which in turn can be used by the host application to fetch data from the Rewards system (see documentation for the Rewards). In order to fetch that token, the application must have a valid user (represented by the Identity). That user must be active.

Required information

*Identity: In order to fetch that token, the application must have a valid user (represented by the Identity). That user must be active.

Concrete example

To fetch the token, one can use the following snippet

let rewards = RewardsService(identity: id)
rewards.fetchToken(then: { result in
    let token = result.value.token
    guard !token.isEmpty else {
        // failure
        return
    }
    completionHandler(.success(token))
})

Last updated