Ads
-
RichieAds is the old main interface to Richie SDK’s ad system. You should look at
RichieAdsControllerwith new code.NOTE: Many RichieAds methods are thread-safe, but their correct operation from the caller’s point of view requires them to be called from a single thread. Use RichieAds from main thread only.
-placeholderImageForAdWithIdentifier:methods are explicitly safe and good to be used from any thread.Timing of calling
-startLoadingAdand-containerWillBeDeletedmay result in situations the caller didn’t intend or could not foresee, if multiple places of an app call these from multiple threads. Download state will change in a background thread, meaning calling-startLoadingAdWithIdentifier:and immediately calling-hasLoadedAdWithIdentifier:may returnYES,in case an actual download wasn’t required (creative had been downloaded to another container).It’s safe to manipulate a container from a single thread (preferably the main thread, which is used to post notifications). Even then state can be unexpected after calling
See more-startLoadingAdWithIdentifier:.A supported and safe pattern is to usehasLoadedAdWithIdentifier:and then start loading the ad with-startLoadingAdWithIdentifier:if ad hasn’t been loaded. App should then wait for ad did load notification.Declaration
Objective-C
@interface RichieAds : NSObjectSwift
@MainActor class RichieAds : NSObject -
Undocumented
See moreDeclaration
Objective-C
@interface RichieAdsSlotAdFlight : NSObject -(nonnull instancetype) init NS_UNAVAILABLE; @endSwift
class RichieAdsSlotAdFlight : NSObject -
Undocumented
See moreDeclaration
Objective-C
@interface RichieAdsView : UIView @property (nonatomic, readonly, nonnull) NSString *adIdentifier; -(void) didAppear; //!< MUST be called by host application when RichieAdsView becomes visible on screen and can be interacted by the user. NOTE: implementation cause heavy operations, don't call while app must stay responsive. Do not call this method until the view is actually visible on screen and the user is able to begin interacting with it. Calling this method prematurely will cause possible animations and timers of creatives to be wrong. -(void) didDisappear; //!< MUST be called by host application when RichieAdsView is not visible on screen and user cannot interact with it anymore. This method automatically does nothing if a modal viewController is presented over the -richieView:viewControllerForPresentingModalInAppBrowserForURL:. -(void) preloadAdContent; //!< Can be called to hint the RichieAdsView to preload HTML ad content without making it active. This operation can be heavy and it can cause performance issues and increased memory usage. Use with caution. -(void) invalidate; //!< SHOULD be called when view is removed from view hierarchy and discarded. -(void) setMaximumResizeSize:(CGSize)maximumResizeSize; //!< SHOULD be called when view is laid out, so it can provide the information for MRAID compliant creative. @property (nonatomic, readonly, weak, nullable) id<RichieAdsViewDelegate> delegate; @endSwift
class RichieAdsView : UIView -
Deprecated
Undocumented
Declaration
Objective-C
extern NSString * const _Nonnull RichieAdsDidFailLoadingAdNotificationSwift
static let RichieAdsDidFailLoadingAd: NSNotification.Name -
Deprecated
Undocumented
Declaration
Objective-C
extern NSString * const _Nonnull RichieAdsDidLoadAdNotificationSwift
static let RichieAdsDidLoadAd: NSNotification.Name -
Deprecated
Undocumented
Declaration
Objective-C
extern NSString * const _Nonnull RichieAdsDidProgressDownloadingAdNotificationSwift
static let RichieAdsDidProgressDownloadingAd: NSNotification.Name -
Deprecated
Undocumented
Declaration
Objective-C
extern NSString * const _Nonnull RichieAdsDidStartLoadingAdNotificationSwift
static let RichieAdsDidStartLoadingAd: NSNotification.Name -
Undocumented
Declaration
Objective-C
extern NSString * _Nonnull const RichieAdsErrorDomainSwift
let RichieAdsErrorDomain: String -
Undocumented
Declaration
Objective-C
extern NSString * const _Nonnull RichieAdsSlotsDidChangeNotificationSwift
static let RichieAdsSlotsDidChange: NSNotification.Name -
Deprecated
Undocumented
Declaration
Objective-C
extern NSString * const _Nonnull kRichieAdsAdIdentifierKeySwift
let kRichieAdsAdIdentifierKey: String -
Deprecated
Undocumented
Declaration
Objective-C
extern NSString * const _Nonnull kRichieAdsContainerURLKeySwift
let kRichieAdsContainerURLKey: String -
Deprecated
Undocumented
Declaration
Objective-C
extern NSString * const _Nonnull kRichieAdsDownloadedBytesKeySwift
let kRichieAdsDownloadedBytesKey: String -
Deprecated
Undocumented
Declaration
Objective-C
extern NSString * const _Nonnull kRichieAdsErrorKeySwift
let kRichieAdsErrorKey: String -
Deprecated
Undocumented
Declaration
Objective-C
extern NSString * const _Nonnull kRichieAdsExpectedTotalBytesKeySwift
let kRichieAdsExpectedTotalBytesKey: String -
Undocumented
See moreDeclaration
Objective-C
@protocol RichieAdsViewDelegate <NSObject> @required -(nonnull UIViewController *) viewControllerForPresentingFromRichieAdsView:(nonnull RichieAdsView *)view; @optional -(void) richieAdsViewDidShowContent:(nonnull RichieAdsView *)view; //!< Called when RichieAdsView has loaded some content (placeholder image or HTML) for display. -(BOOL) richieAdsView:(nonnull RichieAdsView *)view wantsResizeToFrame:(CGRect)frame; //!< Return YES if the view will be (or already has been) resized to the supplied frame. -(void) richieAdsViewResizeEnded:(nonnull RichieAdsView *)view; @endSwift
@MainActor protocol RichieAdsViewDelegate : NSObjectProtocol
Ads Reference