Send Progress Event (Tracked Event)

Tracked Event challenges track the progress of any non-registration related in-application event specified via the namedEvent string. Like every win condition, a time constraint can be applied to this win condition. An example of this challenge would be: Pick up 50 gold coins in the next 2 days.

Android

Send a progress event for a Tracked Event challenge.

/**
* @property name Challenge / Event Name
* @property value Optional numeric value which can be used for tracking progress.
* @return VsLiveData with a success bool
*/
fun sendProgressEvent(name: String, value: Int?): VsLiveData<ChallengeUpdated>
SDK.Challenges.sendProgressEvent("challenge name","value")
  .observe(object : VsObserver<Boolean>() {
    override fun onError(error: Throwable) {}

    override fun onChanged(t: Boolean) {}
})

iOS

/// - Parameters:
///   - eventName: Name of the event relevant to this progress update
///   - value: Represents the value being tracked on the challenge
///   - completionHandler: Closure which returns a Challenge instance
update(eventName: String, value: Int, completionHandler: @escaping VersusApiResponse<Challenge>)
VersusSDK?.update(eventName: eventName, value: value, completionHandler: { (challenge, error) in
    if error != nil {
        // error occurred
    } else {
        // Successfully updated the returned `challenge`
    }
})