UNPKG

react-native-aps

Version:
66 lines (65 loc) 2.38 kB
import { AdLoaderEvent } from './types/AdLoaderEvent'; import type { AdLoaderListener } from './types/AdLoaderListener'; import { AdLoaderOptions, BannerAdLoaderOptions } from './types/AdLoaderOptions'; import { AdType } from './types/AdType'; /** * @public */ export declare class AdLoader { readonly adType: AdType; readonly adLoaderOptions: AdLoaderOptions; private static readonly _nativeModule; private static readonly _eventEmitter; private static _adLoaders; private loaderId; private constructor(); /** * Create a banner AdLoader instance. * @param adLoaderOptions - `BannerAdLoaderOptions` object used to configure the bid request. * @returns AdLoader instance. */ static createBannerAdLoader(adLoaderOptions: BannerAdLoaderOptions): AdLoader; /** * Create a interstitial AdLoader instance. * @param adLoaderOptions - `AdLoaderOptions` object used to configure the bid request. * @returns AdLoader instance. */ static createInterstitialAdLoader(adLoaderOptions: AdLoaderOptions): AdLoader; /** * Add a listener for the bid response. Supported events are: * - `AdLoaderEvent.SUCCESS` * - `AdLoaderEvent.FAILURE` * @param eventName - The name of the event to listen. * @param listener - The listener to be called when the event is fired. * * @returns Unsubscribe function. * * @public */ addListener<E extends AdLoaderEvent>(eventName: E, listener: AdLoaderListener<E>): () => void; /** * Request APS for a bid. Only a single ad size and slotUUID is supported per bid request. * This method will return a promise that resolves a bid response requested by this call. * In order to receive further bid responses returned by auto refresh, you must register listeners via `addListener()`. * @returns Promise of key value pairs from returned bid response. * * @public */ loadAd(): Promise<{ [key: string]: string; }>; /** * Stop the auto refresh of the ad. * * @public */ stopAutoRefresh(): void; /** * In order for SKAdNetwork to work, pass the app event. * @param name - The name of the event. * @param info - The data/info with the event. * * @public */ static skadnHelper(name: string, info?: string): void; }