Rewarded Video - Atmosplay/AtmosplayAds-iOS Wiki

Create a rewarded ad object

Rewarded ads are requested and shown by AtmosplayRewardedVideo objects. The first step in using one is to instantiate it and set its app ID, ad unit ID. For example, here's how to create a AtmosplayRewardedVideo:

#import <AtmosplayAds/AtmosplayRewardedVideo.h>
@interface AtmosplayRewardedVideoViewController () <AtmosplayRewardedVideoDelegate>
@property (nonatomic) AtmosplayRewardedVideo *rewardedVideo;
@end

@implementation AtmosplayBannerViewController
- (void)createAndLoadRewardedVideo {
    self.rewardedVideo = [[AtmosplayInterstitial alloc] initWithAppID:@"Your_App_ID" adUnitID:@"Your_AdUnitID"];
    self.rewardedVideo.delegate = self;
    self.rewardedVideo.autoLoad = YES;
    [self.rewardedVideo loadAd]
}
@end

Show the ad

- (void)showRewardedVideo {
    // ad is not ready, do nothing
    if (!self.rewardedVideo.ready) {
        return;
    }
    // show the ad
    [self.rewardedVideo showRewardedVideoWithViewController:self];
}

Implementing rewarded video events

/// Tells the delegate that the user should be rewarded.
- (void)atmosplayRewardedVideoDidReceiveReward:(AtmosplayRewardedVideo *)ads {
}

/// Tells the delegate that succeeded to load ad.
- (void)atmosplayRewardedVideoDidLoad:(AtmosplayRewardedVideo *)ads {
}

/// Tells the delegate that failed to load ad.
- (void)atmosplayRewardedVideo:(AtmosplayRewardedVideo *)ads didFailToLoadWithError:(NSError *)error {
}

/// Tells the delegate that user starts playing the ad.
- (void)atmosplayRewardedVideoDidStartPlaying:(AtmosplayRewardedVideo *)ads {
}

/// Tells the delegate that the ad is being fully played.
- (void)atmosplayRewardedVideoDidEndPlaying:(AtmosplayRewardedVideo *)ads {
}

/// Tells the delegate that the landing page did present on the screen.
- (void)atmosplayRewardedVideoDidPresentLandingPage:(AtmosplayRewardedVideo *)ads {
}

/// Tells the delegate that the ad did animate off the screen.
- (void)atmosplayRewardedVideoDidDismissScreen:(AtmosplayRewardedVideo *)ads {
}

/// Tells the delegate that the ad is clicked
- (void)atmosplayRewardedVideoDidClick:(AtmosplayRewardedVideo *)ads {
}
⚠️ **GitHub.com Fallback** ⚠️