POBRewardedAd Class Reference
| Inherits from | NSObject |
|---|---|
| Conforms to | POBBidEvent |
| Declared in | POBRewardedAd.h |
+ rewardedAdWithPublisherId:profileId:adUnitId:
Initializes & returns a newly created Rewarded ad instance
+ (POBRewardedAd *_Nullable)rewardedAdWithPublisherId:(NSString *)publisherId profileId:(NSNumber *)profileId adUnitId:(NSString *)adUnitIdParameters
publisherId |
Unique identifier assigned at the time of publisher onboarding. |
|---|---|
profileId |
profile id |
adUnitId |
OpenWrap ad unit id used to identify unique placement on screen |
Return Value
Instance of POBRewardedAd
Declared In
POBRewardedAd.h
+ rewardedAdWithPublisherId:profileId:adUnitId:eventHandler:
Creates & maps a POBRewardedAd instance for an ad server ad unit id used while creating the handler.
+ (POBRewardedAd *_Nullable)rewardedAdWithPublisherId:(NSString *)publisherId profileId:(NSNumber *)profileId adUnitId:(NSString *)adUnitId eventHandler:(id<POBRewardedAdEvent>)eventHandlerParameters
publisherId |
Unique identifier assigned at the time of publisher onboarding. |
|---|---|
profileId |
profile id |
adUnitId |
OpenWrap ad unit id used to identify unique placement on screen |
eventHandler |
Object conforming to POBRewardedAdEvent protocol |
Return Value
Instance of POBRewardedAd
Discussion
This is a convenient way of creating & maintaining a single rewarded ad instance per ad server ad unit(used while creating the handler).
Declared In
POBRewardedAd.h
– loadAdWithResponse:forBiddingHost:
Initiate the loading of a rewarded ad, with the passed bid response for specific bidder.
- (void)loadAdWithResponse:(NSString *)bidResponse forBiddingHost:(POBSDKBiddingHost)biddingHostParameters
bidResponse |
Stringified JSON bid response as per Open-RTB standard. |
|---|---|
biddingHost |
Bidding host for which bid response is applicable. @seealso POBSDKBiddingHost |
Discussion
This API expects the response with ORTB v2.5 specification.
Declared In
POBRewardedAd.h
– bid
Returns the winning bid that will be used to render the ad
- (POBBid *)bidDeclared In
POBRewardedAd.h
– setSkipAlertInfoWithTitle:message:closeButtonTitle:resumeButtonTitle:
Sets title, message & button texts to be used while showing the skip alert.
- (void)setSkipAlertInfoWithTitle:(NSString *)title message:(NSString *)message closeButtonTitle:(NSString *)closeTitle resumeButtonTitle:(NSString *)resumeTitleParameters
title |
alert title |
|---|---|
message |
alert message |
closeTitle |
title of the close button |
resumeTitle |
title of the resume button |
Discussion
If any of the parameters is empty the SDK discards all the values & shows a default skip alert.
Declared In
POBRewardedAd.h
– showFromViewController:
Presents an rewarded ad in full screen view until the user dismisses it. Calling this method has no effect until the ad is received(rewardedAdDidReceiveAd:) and is ready to show, i.e. ‘isReady’ flag is true.
- (void)showFromViewController:(UIViewController *)controllerParameters
controller |
UIViewController to be used for presenting the rewarded ad. |
|---|
Declared In
POBRewardedAd.h
– showFromViewController:withCustomData:
Presents an rewarded ad in full screen view until the user dismisses it. Calling this method has no effect until the ad is received(rewardedAdDidReceiveAd:) and is ready to show, i.e. ‘isReady’ flag is true.
- (void)showFromViewController:(UIViewController *)controller withCustomData:(NSDictionary *_Nullable)customDataParameters
controller |
UIViewController to be used for presenting the rewarded ad. |
|---|---|
customData |
Additional custom data to be used for showing rewarded ad. |
Discussion
to pass any custom data to the ad server, use kPOBAdServerCustomDataKey To pass selected reward, use kPOBSelectedRewardKey
Declared In
POBRewardedAd.h
– addExtraInfoWithKey:andValue:
Adds an extra info for the rewarded ad in a dictionary.
- (void)addExtraInfoWithKey:(NSString *)key andValue:(id)valueParameters
key |
Parameter key |
|---|---|
value |
Parameter value |
Declared In
POBRewardedAd.h
availableRewards
Available rewards when multiple rewards are configured for a rewarded ad
@property (nonatomic, strong, readonly) NSArray<POBReward*> *availableRewardsDiscussion
When multiple rewards are configured, you can use this property to get the available rewards for a valid rewarded ad. You need to set selectedReward property to offer a reward to the user who watches ad till completion. Calling this method has no effect until the ad is received(rewardedAdDidReceiveAd:) and is ready to show, i.e. ‘isReady’ flag is true.
Declared In
POBRewardedAd.h
delegate
Sets the POBRewardedAdDelegate delegate receiver for the rewarded ad
@property (nonatomic, weak) id<POBRewardedAdDelegate> delegateDiscussion
Warning: Proper reference management practices should be observed when using delegates.
Warning: Ensure that the delegate is set to nil prior to setting nil to POBRewardedAd’s object reference.
Declared In
POBRewardedAd.h
request
Object representing bid request
@property (nonatomic, readonly) POBRequest *requestDiscussion
You may set some additional targeting parameters on this object
Declared In
POBRewardedAd.h
impression
Managed impression object created internally. It provides APIs to set other custom parameterss
@property (nonatomic, readonly) POBImpression *impressionDeclared In
POBRewardedAd.h
isReady
Returns YES if the rewarded ad is ready to be displayed. The delegate’s rewardedAdDidReceiveAd: will be called after this property switches from NO to YES.
@property (nonatomic, assign, readonly) BOOL isReadyDeclared In
POBRewardedAd.h