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 *)adUnitId
Parameters
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>)eventHandler
Parameters
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:
Loads a rewarded ad from the provided RTB response
- (void)loadAdWithResponse:(NSString *)response
Parameters
response |
response string as per Open-RTB 2.5 standard |
---|
Declared In
POBRewardedAd.h
– bid
Returns the winning bid that will be used to render the ad
- (POBBid *)bid
Declared 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 *)resumeTitle
Parameters
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 *)controller
Parameters
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)customData
Parameters
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
availableRewards
Available rewards when multiple rewards are configured for a rewarded ad
@property (nonatomic, strong, readonly) NSArray<POBReward*> *availableRewards
Discussion
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> delegate
Discussion
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 *request
Discussion
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 PubMatic zone id and other custom parameterss
@property (nonatomic, readonly) POBImpression *impression
Declared 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 isReady
Declared In
POBRewardedAd.h