iOS SDK Version
FBRewardedVideoAd
@interfaceFBRewardedVideoAd: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(readonly,copy,nonatomic)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(readonly,assign,nonatomic)CMTimeduration;
Swiftvarduration:CMTime{get}
- the delegate
Declaration
Objective-C@property(readwrite,nonatomic,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(readonly,getter=isAdValid,nonatomic)BOOLadValid;
SwiftvarisAdValid:Bool{get}
- FBAdExtraHint to provide extra info
Declaration
Objective-C@property(readwrite,strong,nonatomic,nullable)FBAdExtraHint*extraHint;
SwiftvarextraHint:FBAdExtraHint?{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:UIViewController)->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:UIViewController,animatedflag:Bool)->Bool
Parameters