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;
    Swift
    varplacementID: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;
    Swift
    varduration:CMTime{get}
  • the delegate

    Declaration

    Objective-C
    @property(nonatomic,weak,nullable)id<FBRewardedVideoAdDelegate>delegate;
    Swift
    weakvardelegate: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;
    Swift
    varisAdValid:Bool{get}
  • FBAdExtraHint to provide extra info

    Declaration

    Objective-C
    @property(nonatomic,strong,nullable)FBAdExtraHint*extraHint;
    Swift
    varextraHint: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;
    Swift
    init(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;
    Swift
    init(placementID:String,withUserIDuserID:String?,withCurrencycurrency:String?)
  • Begins loading the FBRewardedVideoAd content.
    You can implement rewardedVideoAdDidLoad: and rewardedVideoAd:didFailWithError: methods of FBRewardedVideoAdDelegate if you would like to be notified as loading succeeds or fails.

    Declaration

    Objective-C
    -(void)loadAd;
    Swift
    funcload()
  • Begins loading the FBRewardedVideoAd content from a bid payload attained through a server side bid.
    You can implement rewardedVideoAdDidLoad: and rewardedVideoAd:didFailWithError: methods of FBRewardedVideoAdDelegate if you would like to be notified as loading succeeds or fails.

    Declaration

    Objective-C
    -(void)loadAdWithBidPayload:(nonnullNSString*)bidPayload;
    Swift
    funcload(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;
    Swift
    funcsetRewardDataWithUserID(_userID:String,withCurrencycurrency:String)->Bool
  • Presents the rewarded video ad modally from the specified view controller.
    You can implement rewardedVideoAdDidClick: and rewardedVideoAdWillClose: methods of FBRewardedVideoAdDelegate if you would like to stay informed for those events.

    Declaration

    Objective-C
    -(BOOL)showAdFromRootViewController:(nonnullUIViewController*)rootViewController;
    Swift
    funcshow(fromRootViewControllerrootViewController:Any!)->Bool

    Parameters

  • Presents the rewarded video ad modally from the specified view controller.
    You can implement rewardedVideoAdDidClick: and rewardedVideoAdWillClose: methods of FBRewardedVideoAdDelegate if you would like to stay informed for those events.

    Declaration

    Objective-C
    -(BOOL)showAdFromRootViewController:(nonnullUIViewController*)rootViewControlleranimated:(BOOL)flag;
    Swift
    funcshow(fromRootViewControllerrootViewController:Any!,animatedflag:Bool)->Bool

    Parameters