iOS SDK Version
FBRewardedVideoAd
Objective-C
@interfaceFBRewardedVideoAd:NSObject
Swift
classFBRewardedVideoAd:NSObject
A modal view controller to represent a Facebook rewarded video ad. This is a full-screen ad shown in your application.
- Typed access to the id of the ad placement.
Declaration
Objective-C@property(nonatomic,copy,readonly)NSString*_NonnullplacementID;
SwiftvarplacementID:String{get}
- The duration of the video, as a CMTime value. Returns kCMTimeIndefinite if no video is loaded.
Declaration
Objective-C@property(nonatomic,readonly)CMTimeduration;
Swiftvarduration:CMTime{get}
- the delegate
Declaration
Objective-C@property(nonatomic,weak,nullable)id<FBRewardedVideoAdDelegate>delegate;
Swiftweakvardelegate:FBRewardedVideoAdDelegate?{getset}
- Returns true if the rewarded video ad has been successfully loaded. You should check
isAdValid
before trying to show the ad.Declaration
Objective-C@property(nonatomic,readonly,getter=isAdValid)BOOLadValid;
SwiftvarisAdValid:Bool{get}
- FBAdExtraHint to provide extra info
Declaration
Objective-C@property(nonatomic,strong,nullable)FBAdExtraHint*extraHint;
SwiftvarextraHint:FBAdExtraHint?{getset}
- FBAdExperiencConfig to provide additional ad configuration
Declaration
Objective-C@property(nonatomic,copy,nullable)FBAdExperienceConfig*adExperienceConfig;
Swift@NSCopyingvaradExperienceConfig:FBAdExperienceConfig?{getset}
- This is a method to initialize an FBRewardedVideoAd matching the given placement id.
Declaration
Objective-C-(nonnullinstancetype)initWithPlacementID:(nonnullNSString*)placementID;
Swiftinit(placementID:String)
Parameters
- This is a method to initialize an FBRewardedVideoAd matching the given placement id and allows the publisher to set the reward to give to a user.
Declaration
Objective-C-(nonnullinstancetype)initWithPlacementID:(nonnullNSString*)placementIDwithUserID:(nullableNSString*)userIDwithCurrency:(nullableNSString*)currency;
Swiftinit(placementID:String,withUserIDuserID:String?,withCurrencycurrency:String?)
- Begins loading the FBRewardedVideoAd content.You can implement
rewardedVideoAdDidLoad:
andrewardedVideoAd:didFailWithError:
methods ofFBRewardedVideoAdDelegate
if you would like to be notified as loading succeeds or fails.Declaration
Objective-C-(void)loadAd;
Swiftfuncload()
- Begins loading the FBRewardedVideoAd content from a bid payload attained through a server side bid.You can implement
rewardedVideoAdDidLoad:
andrewardedVideoAd:didFailWithError:
methods ofFBRewardedVideoAdDelegate
if you would like to be notified as loading succeeds or fails.Declaration
Objective-C-(void)loadAdWithBidPayload:(nonnullNSString*)bidPayload;
Swiftfuncload(withBidPayloadbidPayload:String)
- This method allows the publisher to set the reward to give to a user. Returns NO if it was not able to set Reward Data.
Declaration
Objective-C-(BOOL)setRewardDataWithUserID:(nonnullNSString*)userIDwithCurrency:(nonnullNSString*)currency;
SwiftfuncsetRewardDataWithUserID(_userID:String,withCurrencycurrency:String)->Bool
- Presents the rewarded video ad modally from the specified view controller.You can implement
rewardedVideoAdDidClick:
andrewardedVideoAdWillClose:
methods ofFBRewardedVideoAdDelegate
if you would like to stay informed for those events.Declaration
Objective-C-(BOOL)showAdFromRootViewController:(nonnullUIViewController*)rootViewController;
Swiftfuncshow(fromRootViewControllerrootViewController:Any!)->Bool
Parameters
- Presents the rewarded video ad modally from the specified view controller.You can implement
rewardedVideoAdDidClick:
andrewardedVideoAdWillClose:
methods ofFBRewardedVideoAdDelegate
if you would like to stay informed for those events.Declaration
Objective-C-(BOOL)showAdFromRootViewController:(nonnullUIViewController*)rootViewControlleranimated:(BOOL)flag;
Swiftfuncshow(fromRootViewControllerrootViewController:Any!,animatedflag:Bool)->Bool
Parameters