SASReward

Objective-C

@interface SASReward : NSObject

Swift

class SASReward : NSObject

Class that represents a reward object collected after an ad event.

  • The amount of currency to be rewarded.

    Let you know the amount to reward for a given currency.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSNumber *_Nonnull amount;

    Swift

    var amount: NSNumber { get }
  • The currency of the reward (e.g coins, lives, points…).

    Let you know which currency should be rewarded. Different currencies can lead to different behavior in your app…

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSString *_Nonnull currency;

    Swift

    var currency: String { get }
  • The secured transaction token associated with the reward. Base64 encoded.

    Decrypt this token with your Private Key (RSA-1024) to ensure the ad was delivered from Smart Ad Server. Return format of the token is: “{uniquetokenprovidedwhenloadingthead}|iid:{deliveredinsertionid}”

    Check the documentation: https://documentation.smartadserver.com/DisplaySDK for more information.

    Declaration

    Objective-C

    @property (nonatomic, readonly, nullable) NSString *securedTransactionToken;

    Swift

    var securedTransactionToken: String? { get }
  • The duration of the video ad that has been played to deliver this reward, in seconds. -1 if this duration is unknown.

    Declaration

    Objective-C

    @property (nonatomic, readonly) NSTimeInterval rewardedVideoDuration;

    Swift

    var rewardedVideoDuration: TimeInterval { get }
  • Instantiates a new reward using an amount and a currency.

    Note

    The instantiation might fail if the currency’s length is equal to 0.

    Declaration

    Objective-C

    - (nullable instancetype)initWithAmount:(nonnull NSNumber *)amount
                                   currency:(nonnull NSString *)currency;

    Swift

    init?(amount: NSNumber, currency: String)

    Parameters

    amount

    The amount of currency to be rewarded.

    currency

    The currency of the reward (e.g coins, lives, points…).

    Return Value

    The instantiated reward if the parameters are valid, nil otherwise.