@ezoic/react-native-sdk 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EzoicReactNativeSdk.podspec +1 -1
- package/README.md +63 -3
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/ezoic/reactnative/EzoicAdsModule.kt +129 -0
- package/android/src/main/java/com/ezoic/reactnative/EzoicOutstreamAdViewManager.kt +191 -0
- package/android/src/main/java/com/ezoic/reactnative/EzoicReactNativeSdkPackage.kt +2 -1
- package/ios/EzoicAdsImpl.swift +160 -0
- package/ios/EzoicOutstreamAdHostView.swift +86 -0
- package/ios/EzoicOutstreamAdViewComponentView.mm +105 -0
- package/ios/EzoicReactNativeSdk.mm +41 -0
- package/lib/module/EzoicInstreamAd.js +91 -0
- package/lib/module/EzoicInstreamAd.js.map +1 -0
- package/lib/module/EzoicOutstreamAdViewNativeComponent.ts +23 -0
- package/lib/module/NativeEzoicAds.js.map +1 -1
- package/lib/module/index.js +30 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/EzoicInstreamAd.d.ts +86 -0
- package/lib/typescript/src/EzoicInstreamAd.d.ts.map +1 -0
- package/lib/typescript/src/EzoicOutstreamAdViewNativeComponent.d.ts +18 -0
- package/lib/typescript/src/EzoicOutstreamAdViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/NativeEzoicAds.d.ts +4 -0
- package/lib/typescript/src/NativeEzoicAds.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +22 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/EzoicInstreamAd.ts +110 -0
- package/src/EzoicOutstreamAdViewNativeComponent.ts +23 -0
- package/src/NativeEzoicAds.ts +18 -0
- package/src/index.tsx +53 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import UIKit
|
|
2
|
+
import EzoicAdsSDKBinary
|
|
3
|
+
|
|
4
|
+
/// Bridge protocol the Fabric component view implements to receive outstream
|
|
5
|
+
/// events. Mirrors `EzoicNativeAdHostViewDelegate` — the ObjC++ component view
|
|
6
|
+
/// forwards these onto the Fabric `_eventEmitter`.
|
|
7
|
+
@objc public protocol EzoicOutstreamAdHostViewDelegate: AnyObject {
|
|
8
|
+
func outstreamAdDidLoad()
|
|
9
|
+
func outstreamAdDidFail(_ message: String, code: Int)
|
|
10
|
+
func outstreamAdDidRecordImpression()
|
|
11
|
+
func outstreamAdDidRecordClick()
|
|
12
|
+
func outstreamAdWillPresentScreen()
|
|
13
|
+
func outstreamAdDidDismissScreen()
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/// Host `UIView` wrapping the native `EzoicOutstreamAdView`. Unlike the native
|
|
17
|
+
/// ad (which returns a `NativeAd` we build a template around), the native
|
|
18
|
+
/// outstream view renders itself (it attaches its own `AdManagerBannerView`),
|
|
19
|
+
/// so this host just embeds it edge-to-edge, wires the delegate before
|
|
20
|
+
/// `loadAd()`, and tears it down on `deinit`.
|
|
21
|
+
///
|
|
22
|
+
/// Load is deferred to `startLoad()` (called from the component view's
|
|
23
|
+
/// `finalizeUpdates`) so the Fabric event emitter is attached before the native
|
|
24
|
+
/// SDK can fail synchronously (uninitialized) and emit `onError`.
|
|
25
|
+
@objc public class EzoicOutstreamAdHostView: UIView, EzoicOutstreamAdViewDelegate {
|
|
26
|
+
|
|
27
|
+
@objc public weak var hostDelegate: EzoicOutstreamAdHostViewDelegate?
|
|
28
|
+
|
|
29
|
+
private var adUnitId: Int = 0
|
|
30
|
+
private var outstreamView: EzoicOutstreamAdView?
|
|
31
|
+
private var loadStarted = false
|
|
32
|
+
|
|
33
|
+
/// Stores the ad unit id. The load is NOT started here — the Fabric
|
|
34
|
+
/// component view calls `startLoad()` from `finalizeUpdates`.
|
|
35
|
+
@objc public func configure(adUnitIdentifier: String) {
|
|
36
|
+
self.adUnitId = Int(adUnitIdentifier) ?? 0
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/// Builds the native outstream view, wires its delegate BEFORE `loadAd()`,
|
|
40
|
+
/// embeds it edge-to-edge, and loads once. A second call is a no-op; the
|
|
41
|
+
/// guard survives repeated `finalizeUpdates` calls.
|
|
42
|
+
@objc public func startLoad() {
|
|
43
|
+
if loadStarted { return }
|
|
44
|
+
loadStarted = true
|
|
45
|
+
|
|
46
|
+
let view = EzoicOutstreamAdView(adUnitIdentifier: adUnitId)
|
|
47
|
+
// Delegate before loadAd so no early lifecycle callback is missed.
|
|
48
|
+
view.delegate = self
|
|
49
|
+
view.translatesAutoresizingMaskIntoConstraints = false
|
|
50
|
+
addSubview(view)
|
|
51
|
+
NSLayoutConstraint.activate([
|
|
52
|
+
view.topAnchor.constraint(equalTo: topAnchor),
|
|
53
|
+
view.leadingAnchor.constraint(equalTo: leadingAnchor),
|
|
54
|
+
view.trailingAnchor.constraint(equalTo: trailingAnchor),
|
|
55
|
+
view.bottomAnchor.constraint(equalTo: bottomAnchor),
|
|
56
|
+
])
|
|
57
|
+
self.outstreamView = view
|
|
58
|
+
view.loadAd()
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// MARK: - EzoicOutstreamAdViewDelegate
|
|
62
|
+
public func outstreamViewDidLoad(_ outstreamView: EzoicOutstreamAdView) {
|
|
63
|
+
hostDelegate?.outstreamAdDidLoad()
|
|
64
|
+
}
|
|
65
|
+
public func outstreamView(_ outstreamView: EzoicOutstreamAdView, didFailToLoadWithError error: EzoicError) {
|
|
66
|
+
hostDelegate?.outstreamAdDidFail(error.localizedDescription, code: error.code)
|
|
67
|
+
}
|
|
68
|
+
public func outstreamViewDidRecordImpression(_ outstreamView: EzoicOutstreamAdView) {
|
|
69
|
+
hostDelegate?.outstreamAdDidRecordImpression()
|
|
70
|
+
}
|
|
71
|
+
public func outstreamViewDidRecordClick(_ outstreamView: EzoicOutstreamAdView) {
|
|
72
|
+
hostDelegate?.outstreamAdDidRecordClick()
|
|
73
|
+
}
|
|
74
|
+
public func outstreamViewWillPresentScreen(_ outstreamView: EzoicOutstreamAdView) {
|
|
75
|
+
hostDelegate?.outstreamAdWillPresentScreen()
|
|
76
|
+
}
|
|
77
|
+
public func outstreamViewDidDismissScreen(_ outstreamView: EzoicOutstreamAdView) {
|
|
78
|
+
hostDelegate?.outstreamAdDidDismissScreen()
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
deinit {
|
|
82
|
+
// The native view also destroys itself on removeFromSuperview, but call it
|
|
83
|
+
// explicitly for a deterministic teardown. Safe to call multiple times.
|
|
84
|
+
outstreamView?.destroy()
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
#import <React/RCTViewComponentView.h>
|
|
2
|
+
#import <react/renderer/components/EzoicReactNativeSdkSpec/ComponentDescriptors.h>
|
|
3
|
+
#import <react/renderer/components/EzoicReactNativeSdkSpec/EventEmitters.h>
|
|
4
|
+
#import <react/renderer/components/EzoicReactNativeSdkSpec/Props.h>
|
|
5
|
+
#import <react/renderer/components/EzoicReactNativeSdkSpec/RCTComponentViewHelpers.h>
|
|
6
|
+
#import <EzoicReactNativeSdk/EzoicReactNativeSdk-Swift.h>
|
|
7
|
+
|
|
8
|
+
using namespace facebook::react;
|
|
9
|
+
|
|
10
|
+
@interface EzoicOutstreamAdView : RCTViewComponentView <EzoicOutstreamAdHostViewDelegate>
|
|
11
|
+
@end
|
|
12
|
+
|
|
13
|
+
@implementation EzoicOutstreamAdView {
|
|
14
|
+
EzoicOutstreamAdHostView *_host;
|
|
15
|
+
NSString *_lastAdUnit;
|
|
16
|
+
BOOL _loadStarted;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider {
|
|
20
|
+
return concreteComponentDescriptorProvider<EzoicOutstreamAdViewComponentDescriptor>();
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
- (instancetype)initWithFrame:(CGRect)frame {
|
|
24
|
+
if (self = [super initWithFrame:frame]) {
|
|
25
|
+
_host = [EzoicOutstreamAdHostView new];
|
|
26
|
+
_host.hostDelegate = self;
|
|
27
|
+
self.contentView = _host;
|
|
28
|
+
}
|
|
29
|
+
return self;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps {
|
|
33
|
+
const auto &newProps = *std::static_pointer_cast<EzoicOutstreamAdViewProps const>(props);
|
|
34
|
+
NSString *adUnit = [NSString stringWithUTF8String:newProps.adUnitIdentifier.c_str()];
|
|
35
|
+
if (![adUnit isEqualToString:_lastAdUnit]) {
|
|
36
|
+
// Ad unit changed after a load already started: swap in a fresh host
|
|
37
|
+
// (mirrors prepareForRecycle) and reset the load guard so finalizeUpdates
|
|
38
|
+
// starts a new load for the new id.
|
|
39
|
+
if (_loadStarted) {
|
|
40
|
+
// Nil the abandoned host's delegate first: a late lifecycle callback from
|
|
41
|
+
// it would otherwise emit a Fabric event for the wrong ad unit.
|
|
42
|
+
_host.hostDelegate = nil;
|
|
43
|
+
[_host removeFromSuperview];
|
|
44
|
+
_host = [EzoicOutstreamAdHostView new];
|
|
45
|
+
_host.hostDelegate = self;
|
|
46
|
+
self.contentView = _host;
|
|
47
|
+
_loadStarted = NO;
|
|
48
|
+
}
|
|
49
|
+
_lastAdUnit = adUnit;
|
|
50
|
+
[_host configureWithAdUnitIdentifier:adUnit];
|
|
51
|
+
}
|
|
52
|
+
[super updateProps:props oldProps:oldProps];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// RCTMountingManager mounts on Insert as updateProps → updateEventEmitter →
|
|
56
|
+
// finalizeUpdates. Starting the load here (not in updateProps) guarantees the
|
|
57
|
+
// event emitter is attached before the native SDK can fail synchronously and
|
|
58
|
+
// emit onError, which would otherwise be dropped while _eventEmitter is nil.
|
|
59
|
+
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask {
|
|
60
|
+
[super finalizeUpdates:updateMask];
|
|
61
|
+
if (!_loadStarted && _lastAdUnit.length > 0) {
|
|
62
|
+
_loadStarted = YES;
|
|
63
|
+
[_host startLoad];
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
- (void)outstreamAdDidLoad {
|
|
68
|
+
if (_eventEmitter) std::static_pointer_cast<EzoicOutstreamAdViewEventEmitter const>(_eventEmitter)->onLoad({});
|
|
69
|
+
}
|
|
70
|
+
- (void)outstreamAdDidFail:(NSString *)message code:(NSInteger)code {
|
|
71
|
+
if (_eventEmitter)
|
|
72
|
+
std::static_pointer_cast<EzoicOutstreamAdViewEventEmitter const>(_eventEmitter)
|
|
73
|
+
->onError({.message = std::string([message UTF8String]), .code = (int)code});
|
|
74
|
+
}
|
|
75
|
+
- (void)outstreamAdDidRecordImpression {
|
|
76
|
+
if (_eventEmitter) std::static_pointer_cast<EzoicOutstreamAdViewEventEmitter const>(_eventEmitter)->onImpression({});
|
|
77
|
+
}
|
|
78
|
+
- (void)outstreamAdDidRecordClick {
|
|
79
|
+
if (_eventEmitter) std::static_pointer_cast<EzoicOutstreamAdViewEventEmitter const>(_eventEmitter)->onAdClick({});
|
|
80
|
+
}
|
|
81
|
+
- (void)outstreamAdWillPresentScreen {
|
|
82
|
+
if (_eventEmitter) std::static_pointer_cast<EzoicOutstreamAdViewEventEmitter const>(_eventEmitter)->onOpen({});
|
|
83
|
+
}
|
|
84
|
+
- (void)outstreamAdDidDismissScreen {
|
|
85
|
+
if (_eventEmitter) std::static_pointer_cast<EzoicOutstreamAdViewEventEmitter const>(_eventEmitter)->onClose({});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
- (void)prepareForRecycle {
|
|
89
|
+
// Recycled views are reused for a new ad unit; rebuild the host (which owns
|
|
90
|
+
// the native EzoicOutstreamAdView, destroyed on deinit) and reset the guards.
|
|
91
|
+
// Nil the delegate first: a late lifecycle callback from the abandoned host
|
|
92
|
+
// would otherwise emit a Fabric event for the wrong ad unit.
|
|
93
|
+
_host.hostDelegate = nil;
|
|
94
|
+
[_host removeFromSuperview];
|
|
95
|
+
_host = [EzoicOutstreamAdHostView new];
|
|
96
|
+
_host.hostDelegate = self;
|
|
97
|
+
self.contentView = _host;
|
|
98
|
+
_lastAdUnit = nil;
|
|
99
|
+
_loadStarted = NO;
|
|
100
|
+
[super prepareForRecycle];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
Class<RCTComponentViewProtocol> EzoicOutstreamAdViewCls(void) { return EzoicOutstreamAdView.class; }
|
|
104
|
+
|
|
105
|
+
@end
|
|
@@ -42,6 +42,11 @@ static NSString *const kEzoicInterstitialEvent = @"EzoicInterstitialAdEvent";
|
|
|
42
42
|
_hasListeners = NO;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
- (void)invalidate {
|
|
46
|
+
[_impl invalidate];
|
|
47
|
+
[super invalidate];
|
|
48
|
+
}
|
|
49
|
+
|
|
45
50
|
- (void)initialize:(JS::NativeEzoicAds::EzoicConfig &)config
|
|
46
51
|
resolve:(RCTPromiseResolveBlock)resolve
|
|
47
52
|
reject:(RCTPromiseRejectBlock)reject {
|
|
@@ -105,6 +110,42 @@ static NSString *const kEzoicInterstitialEvent = @"EzoicInterstitialAdEvent";
|
|
|
105
110
|
reject:^(NSString *code, NSString *msg, NSError *_Nullable e) { reject(code, msg, e); }];
|
|
106
111
|
}
|
|
107
112
|
|
|
113
|
+
- (void)loadInstreamAd:(double)adUnitIdentifier
|
|
114
|
+
contentUrl:(NSString *)contentUrl
|
|
115
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
116
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
117
|
+
[_impl loadInstreamAd:adUnitIdentifier
|
|
118
|
+
contentUrl:contentUrl
|
|
119
|
+
resolve:^(id _Nullable v) { resolve(v); }
|
|
120
|
+
reject:^(NSString *code, NSString *msg, NSError *_Nullable e) { reject(code, msg, e); }];
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
- (void)getInstreamNextAdTagUrl:(double)adUnitIdentifier
|
|
124
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
125
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
126
|
+
[_impl getInstreamNextAdTagUrl:adUnitIdentifier
|
|
127
|
+
resolve:^(id _Nullable v) { resolve(v); }
|
|
128
|
+
reject:^(NSString *code, NSString *msg, NSError *_Nullable e) { reject(code, msg, e); }];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
- (void)reportInstreamImpression:(double)adUnitIdentifier
|
|
132
|
+
revenueUsd:(NSNumber *)revenueUsd
|
|
133
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
134
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
135
|
+
[_impl reportInstreamImpression:adUnitIdentifier
|
|
136
|
+
revenueUsd:revenueUsd
|
|
137
|
+
resolve:^(id _Nullable v) { resolve(v); }
|
|
138
|
+
reject:^(NSString *code, NSString *msg, NSError *_Nullable e) { reject(code, msg, e); }];
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
- (void)destroyInstreamAd:(double)adUnitIdentifier
|
|
142
|
+
resolve:(RCTPromiseResolveBlock)resolve
|
|
143
|
+
reject:(RCTPromiseRejectBlock)reject {
|
|
144
|
+
[_impl destroyInstreamAd:adUnitIdentifier
|
|
145
|
+
resolve:^(id _Nullable v) { resolve(v); }
|
|
146
|
+
reject:^(NSString *code, NSString *msg, NSError *_Nullable e) { reject(code, msg, e); }];
|
|
147
|
+
}
|
|
148
|
+
|
|
108
149
|
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
|
|
109
150
|
(const facebook::react::ObjCTurboModule::InitParams &)params {
|
|
110
151
|
return std::make_shared<facebook::react::NativeEzoicAdsSpecJSI>(params);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import NativeEzoicAds from "./NativeEzoicAds.js";
|
|
4
|
+
|
|
5
|
+
/** Options for {@link EzoicInstreamAd.load}. */
|
|
6
|
+
|
|
7
|
+
/** Options for {@link EzoicInstreamAd.reportImpression}. */
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* An instream video ad controller. Instream video runs inside the host app's
|
|
11
|
+
* OWN video content: **the host owns the video player and the Google IMA SDK**.
|
|
12
|
+
* Unlike the banner/native/outstream views, this controller renders nothing and
|
|
13
|
+
* holds no view — its sole deliverable is a GAM VAST ad-tag URL string the host
|
|
14
|
+
* feeds to its own IMA `AdsRequest`.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
*
|
|
18
|
+
* ```ts
|
|
19
|
+
* const instream = new EzoicInstreamAd('12345');
|
|
20
|
+
* const tagUrl = await instream.load({ contentUrl: playingVideoUrl });
|
|
21
|
+
* // hand tagUrl to your IMA AdsLoader / AdsRequest.
|
|
22
|
+
*
|
|
23
|
+
* // On an IMA ad error, walk down the floor waterfall:
|
|
24
|
+
* const next = await instream.getNextAdTagUrl();
|
|
25
|
+
* if (next) { /* request IMA again with next *\/ }
|
|
26
|
+
*
|
|
27
|
+
* // On the IMA STARTED event, record the Ezoic impression:
|
|
28
|
+
* await instream.reportImpression({ revenueUsd: 0.42 });
|
|
29
|
+
*
|
|
30
|
+
* // When finished with the ad unit:
|
|
31
|
+
* await instream.destroy();
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* Mirrors the native `EzoicInstreamAd` load pipeline on both platforms. Unlike
|
|
35
|
+
* the interstitial/rewarded ads, the controller is **multi-use** and NOT
|
|
36
|
+
* auto-destroying: the native controller is prefetchable and reused across
|
|
37
|
+
* loads for the same id, so the same instance can be loaded again after a
|
|
38
|
+
* previous load resolves. Call {@link destroy} when the unit is no longer
|
|
39
|
+
* needed. There is no event emitter — every result settles the returned
|
|
40
|
+
* promise directly from the native listener/delegate.
|
|
41
|
+
*/
|
|
42
|
+
export class EzoicInstreamAd {
|
|
43
|
+
/** The Ezoic ad unit identifier this controller was created for. */
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param adUnitIdentifier the Ezoic ad unit id (numeric). A string is coerced
|
|
47
|
+
* to a number so callers can pass either; a non-numeric string yields `NaN`,
|
|
48
|
+
* which the native side rejects.
|
|
49
|
+
*/
|
|
50
|
+
constructor(adUnitIdentifier) {
|
|
51
|
+
this.adUnitIdentifier = Number(adUnitIdentifier);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Loads the instream config, runs optional Prebid demand, and resolves with
|
|
56
|
+
* the GAM VAST ad-tag URL for the host's IMA player. Rejects on no fill, an
|
|
57
|
+
* uninitialized SDK, or an overlapping load already in flight for this id.
|
|
58
|
+
* Safe to call again after a previous load resolves (multi-use).
|
|
59
|
+
*/
|
|
60
|
+
load(options) {
|
|
61
|
+
return NativeEzoicAds.loadInstreamAd(this.adUnitIdentifier, options?.contentUrl ?? null);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Pops the current head off the floor waterfall and resolves with the ad tag
|
|
66
|
+
* rebuilt against the next `eb_br` hash, or `null` once the waterfall is
|
|
67
|
+
* exhausted (or before a successful {@link load} / after {@link destroy}).
|
|
68
|
+
* Call this on an IMA ad error to try the next floor.
|
|
69
|
+
*/
|
|
70
|
+
getNextAdTagUrl() {
|
|
71
|
+
return NativeEzoicAds.getInstreamNextAdTagUrl(this.adUnitIdentifier);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Fires the Ezoic impression-event pixel for the most recently delivered tag.
|
|
76
|
+
* Call this on the IMA `STARTED` event. No-op natively when no tag has been
|
|
77
|
+
* delivered or after {@link destroy}.
|
|
78
|
+
*/
|
|
79
|
+
reportImpression(options) {
|
|
80
|
+
return NativeEzoicAds.reportInstreamImpression(this.adUnitIdentifier, options?.revenueUsd ?? null);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Cancels any in-flight load and releases the native controller for this id.
|
|
85
|
+
* A load in flight rejects. Safe to call multiple times.
|
|
86
|
+
*/
|
|
87
|
+
destroy() {
|
|
88
|
+
return NativeEzoicAds.destroyInstreamAd(this.adUnitIdentifier);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=EzoicInstreamAd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeEzoicAds","EzoicInstreamAd","constructor","adUnitIdentifier","Number","load","options","loadInstreamAd","contentUrl","getNextAdTagUrl","getInstreamNextAdTagUrl","reportImpression","reportInstreamImpression","revenueUsd","destroy","destroyInstreamAd"],"sourceRoot":"../../src","sources":["EzoicInstreamAd.ts"],"mappings":";;AAAA,OAAOA,cAAc,MAAM,qBAAkB;;AAE7C;;AAUA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,CAAC;EAC3B;;EAGA;AACF;AACA;AACA;AACA;EACEC,WAAWA,CAACC,gBAAiC,EAAE;IAC7C,IAAI,CAACA,gBAAgB,GAAGC,MAAM,CAACD,gBAAgB,CAAC;EAClD;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEE,IAAIA,CAACC,OAAkC,EAAmB;IACxD,OAAON,cAAc,CAACO,cAAc,CAClC,IAAI,CAACJ,gBAAgB,EACrBG,OAAO,EAAEE,UAAU,IAAI,IACzB,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEC,eAAeA,CAAA,EAA2B;IACxC,OAAOT,cAAc,CAACU,uBAAuB,CAAC,IAAI,CAACP,gBAAgB,CAAC;EACtE;;EAEA;AACF;AACA;AACA;AACA;EACEQ,gBAAgBA,CAACL,OAAwC,EAAiB;IACxE,OAAON,cAAc,CAACY,wBAAwB,CAC5C,IAAI,CAACT,gBAAgB,EACrBG,OAAO,EAAEO,UAAU,IAAI,IACzB,CAAC;EACH;;EAEA;AACF;AACA;AACA;EACEC,OAAOA,CAAA,EAAkB;IACvB,OAAOd,cAAc,CAACe,iBAAiB,CAAC,IAAI,CAACZ,gBAAgB,CAAC;EAChE;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { codegenNativeComponent } from 'react-native';
|
|
2
|
+
import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
|
|
3
|
+
|
|
4
|
+
type LoadEvent = Readonly<{}>;
|
|
5
|
+
type ErrorEvent = Readonly<{ message: string; code: CodegenTypes.Int32 }>;
|
|
6
|
+
|
|
7
|
+
export interface NativeProps extends ViewProps {
|
|
8
|
+
adUnitIdentifier: string;
|
|
9
|
+
onLoad?: CodegenTypes.BubblingEventHandler<LoadEvent> | null;
|
|
10
|
+
onError?: CodegenTypes.BubblingEventHandler<ErrorEvent> | null;
|
|
11
|
+
onImpression?: CodegenTypes.BubblingEventHandler<LoadEvent> | null;
|
|
12
|
+
// `onClick` is reserved by core ViewProps (a gesture handler), so the native
|
|
13
|
+
// outstream-click event is exposed as `onAdClick`. The public
|
|
14
|
+
// `EzoicOutstreamAdView` component maps the user-facing `onClick` prop onto
|
|
15
|
+
// this.
|
|
16
|
+
onAdClick?: CodegenTypes.BubblingEventHandler<LoadEvent> | null;
|
|
17
|
+
onOpen?: CodegenTypes.BubblingEventHandler<LoadEvent> | null;
|
|
18
|
+
onClose?: CodegenTypes.BubblingEventHandler<LoadEvent> | null;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export default codegenNativeComponent<NativeProps>(
|
|
22
|
+
'EzoicOutstreamAdView'
|
|
23
|
+
) as HostComponent<NativeProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeEzoicAds.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;;AAWlD;AACA;AACA;AACA;AACA;AACA;;
|
|
1
|
+
{"version":3,"names":["TurboModuleRegistry","getEnforcing"],"sourceRoot":"../../src","sources":["NativeEzoicAds.ts"],"mappings":";;AACA,SAASA,mBAAmB,QAAQ,cAAc;;AAWlD;AACA;AACA;AACA;AACA;AACA;;AAwCA,eAAeA,mBAAmB,CAACC,YAAY,CAAO,qBAAqB,CAAC","ignoreList":[]}
|
package/lib/module/index.js
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
import NativeEzoicAds from "./NativeEzoicAds.js";
|
|
4
4
|
import EzoicBannerNative from './EzoicBannerViewNativeComponent';
|
|
5
5
|
import EzoicNativeAdNative from './EzoicNativeAdViewNativeComponent';
|
|
6
|
+
import EzoicOutstreamNative from './EzoicOutstreamAdViewNativeComponent';
|
|
6
7
|
import { coerceAdUnitId, normalizeConfig, normalizeSize } from "./helpers.js";
|
|
7
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
9
|
export { EzoicRewardedAd } from "./EzoicRewardedAd.js";
|
|
9
10
|
export { EzoicInterstitialAd } from "./EzoicInterstitialAd.js";
|
|
11
|
+
export { EzoicInstreamAd } from "./EzoicInstreamAd.js";
|
|
10
12
|
export const EzoicAds = {
|
|
11
13
|
initialize(config) {
|
|
12
14
|
return NativeEzoicAds.initialize(normalizeConfig(config));
|
|
@@ -75,4 +77,32 @@ export function EzoicNativeAdView(props) {
|
|
|
75
77
|
onClose: onClose ? () => onClose() : undefined
|
|
76
78
|
});
|
|
77
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Renders an outstream video ad in an SDK-built player. Outstream video runs on
|
|
82
|
+
* its own (not inside host video content), so the SDK owns the player and this
|
|
83
|
+
* component only needs a size. Fills the bounds it is given by its RN style, so
|
|
84
|
+
* size it with `style` (e.g. `{ width: '100%', height: 200 }`).
|
|
85
|
+
*/
|
|
86
|
+
export function EzoicOutstreamAdView(props) {
|
|
87
|
+
const {
|
|
88
|
+
adUnitIdentifier,
|
|
89
|
+
onLoad,
|
|
90
|
+
onError,
|
|
91
|
+
onImpression,
|
|
92
|
+
onClick,
|
|
93
|
+
onOpen,
|
|
94
|
+
onClose,
|
|
95
|
+
...rest
|
|
96
|
+
} = props;
|
|
97
|
+
return /*#__PURE__*/_jsx(EzoicOutstreamNative, {
|
|
98
|
+
...rest,
|
|
99
|
+
adUnitIdentifier: coerceAdUnitId(adUnitIdentifier),
|
|
100
|
+
onLoad: onLoad ? () => onLoad() : undefined,
|
|
101
|
+
onError: onError ? e => onError(e.nativeEvent) : undefined,
|
|
102
|
+
onImpression: onImpression ? () => onImpression() : undefined,
|
|
103
|
+
onAdClick: onClick ? () => onClick() : undefined,
|
|
104
|
+
onOpen: onOpen ? () => onOpen() : undefined,
|
|
105
|
+
onClose: onClose ? () => onClose() : undefined
|
|
106
|
+
});
|
|
107
|
+
}
|
|
78
108
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEzoicAds","EzoicBannerNative","EzoicNativeAdNative","coerceAdUnitId","normalizeConfig","normalizeSize","jsx","_jsx","EzoicRewardedAd","EzoicInterstitialAd","EzoicAds","initialize","config","setGDPRConsent","applies","consentString","setGPPConsent","gppString","sectionIds","setSubjectToCOPPA","value","trackPageview","EzoicBannerView","props","adUnitIdentifier","size","onLoad","onError","onImpression","onClick","onOpen","onClose","rest","undefined","e","nativeEvent","onAdClick","EzoicNativeAdView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AACA,OAAOA,cAAc,MAA4B,qBAAkB;AACnE,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,mBAAmB,MAAM,oCAAoC;AACpE,SAASC,cAAc,EAAEC,eAAe,EAAEC,aAAa,QAAQ,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG3E,SACEC,eAAe,QAGV,sBAAmB;AAC1B,SACEC,mBAAmB,QAEd,0BAAuB;
|
|
1
|
+
{"version":3,"names":["NativeEzoicAds","EzoicBannerNative","EzoicNativeAdNative","EzoicOutstreamNative","coerceAdUnitId","normalizeConfig","normalizeSize","jsx","_jsx","EzoicRewardedAd","EzoicInterstitialAd","EzoicInstreamAd","EzoicAds","initialize","config","setGDPRConsent","applies","consentString","setGPPConsent","gppString","sectionIds","setSubjectToCOPPA","value","trackPageview","EzoicBannerView","props","adUnitIdentifier","size","onLoad","onError","onImpression","onClick","onOpen","onClose","rest","undefined","e","nativeEvent","onAdClick","EzoicNativeAdView","EzoicOutstreamAdView"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AACA,OAAOA,cAAc,MAA4B,qBAAkB;AACnE,OAAOC,iBAAiB,MAAM,kCAAkC;AAChE,OAAOC,mBAAmB,MAAM,oCAAoC;AACpE,OAAOC,oBAAoB,MAAM,uCAAuC;AACxE,SAASC,cAAc,EAAEC,eAAe,EAAEC,aAAa,QAAQ,cAAW;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAG3E,SACEC,eAAe,QAGV,sBAAmB;AAC1B,SACEC,mBAAmB,QAEd,0BAAuB;AAC9B,SACEC,eAAe,QAGV,sBAAmB;AAE1B,OAAO,MAAMC,QAAQ,GAAG;EACtBC,UAAUA,CAACC,MAAmB,EAAiB;IAC7C,OAAOd,cAAc,CAACa,UAAU,CAACR,eAAe,CAACS,MAAM,CAAC,CAAC;EAC3D,CAAC;EACDC,cAAcA,CAACC,OAAgB,EAAEC,aAAsB,EAAQ;IAC7DjB,cAAc,CAACe,cAAc,CAACC,OAAO,EAAEC,aAAa,CAAC;EACvD,CAAC;EACDC,aAAaA,CAACC,SAAkB,EAAEC,UAAmB,EAAQ;IAC3DpB,cAAc,CAACkB,aAAa,CAACC,SAAS,EAAEC,UAAU,CAAC;EACrD,CAAC;EACDC,iBAAiBA,CAACC,KAAc,EAAQ;IACtCtB,cAAc,CAACqB,iBAAiB,CAACC,KAAK,CAAC;EACzC,CAAC;EACDC,aAAaA,CAAA,EAAqB;IAChC,OAAOvB,cAAc,CAACuB,aAAa,CAAC,CAAC;EACvC;A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@link EzoicInstreamAd.load}. */
|
|
2
|
+
export interface EzoicInstreamLoadOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The URL of the video the host is currently playing. When supplied it is
|
|
5
|
+
* added to the VAST ad tag as `url`/`description_url` for contextual
|
|
6
|
+
* targeting. Omit it when the content URL is unknown.
|
|
7
|
+
*/
|
|
8
|
+
contentUrl?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Options for {@link EzoicInstreamAd.reportImpression}. */
|
|
11
|
+
export interface EzoicInstreamImpressionOptions {
|
|
12
|
+
/**
|
|
13
|
+
* The publisher-reported revenue (USD) for this impression, if known. Folded
|
|
14
|
+
* into the Ezoic impression-event pixel. Omit it when no revenue is known.
|
|
15
|
+
*/
|
|
16
|
+
revenueUsd?: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* An instream video ad controller. Instream video runs inside the host app's
|
|
20
|
+
* OWN video content: **the host owns the video player and the Google IMA SDK**.
|
|
21
|
+
* Unlike the banner/native/outstream views, this controller renders nothing and
|
|
22
|
+
* holds no view — its sole deliverable is a GAM VAST ad-tag URL string the host
|
|
23
|
+
* feeds to its own IMA `AdsRequest`.
|
|
24
|
+
*
|
|
25
|
+
* Usage:
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* const instream = new EzoicInstreamAd('12345');
|
|
29
|
+
* const tagUrl = await instream.load({ contentUrl: playingVideoUrl });
|
|
30
|
+
* // hand tagUrl to your IMA AdsLoader / AdsRequest.
|
|
31
|
+
*
|
|
32
|
+
* // On an IMA ad error, walk down the floor waterfall:
|
|
33
|
+
* const next = await instream.getNextAdTagUrl();
|
|
34
|
+
* if (next) { /* request IMA again with next *\/ }
|
|
35
|
+
*
|
|
36
|
+
* // On the IMA STARTED event, record the Ezoic impression:
|
|
37
|
+
* await instream.reportImpression({ revenueUsd: 0.42 });
|
|
38
|
+
*
|
|
39
|
+
* // When finished with the ad unit:
|
|
40
|
+
* await instream.destroy();
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Mirrors the native `EzoicInstreamAd` load pipeline on both platforms. Unlike
|
|
44
|
+
* the interstitial/rewarded ads, the controller is **multi-use** and NOT
|
|
45
|
+
* auto-destroying: the native controller is prefetchable and reused across
|
|
46
|
+
* loads for the same id, so the same instance can be loaded again after a
|
|
47
|
+
* previous load resolves. Call {@link destroy} when the unit is no longer
|
|
48
|
+
* needed. There is no event emitter — every result settles the returned
|
|
49
|
+
* promise directly from the native listener/delegate.
|
|
50
|
+
*/
|
|
51
|
+
export declare class EzoicInstreamAd {
|
|
52
|
+
/** The Ezoic ad unit identifier this controller was created for. */
|
|
53
|
+
readonly adUnitIdentifier: number;
|
|
54
|
+
/**
|
|
55
|
+
* @param adUnitIdentifier the Ezoic ad unit id (numeric). A string is coerced
|
|
56
|
+
* to a number so callers can pass either; a non-numeric string yields `NaN`,
|
|
57
|
+
* which the native side rejects.
|
|
58
|
+
*/
|
|
59
|
+
constructor(adUnitIdentifier: string | number);
|
|
60
|
+
/**
|
|
61
|
+
* Loads the instream config, runs optional Prebid demand, and resolves with
|
|
62
|
+
* the GAM VAST ad-tag URL for the host's IMA player. Rejects on no fill, an
|
|
63
|
+
* uninitialized SDK, or an overlapping load already in flight for this id.
|
|
64
|
+
* Safe to call again after a previous load resolves (multi-use).
|
|
65
|
+
*/
|
|
66
|
+
load(options?: EzoicInstreamLoadOptions): Promise<string>;
|
|
67
|
+
/**
|
|
68
|
+
* Pops the current head off the floor waterfall and resolves with the ad tag
|
|
69
|
+
* rebuilt against the next `eb_br` hash, or `null` once the waterfall is
|
|
70
|
+
* exhausted (or before a successful {@link load} / after {@link destroy}).
|
|
71
|
+
* Call this on an IMA ad error to try the next floor.
|
|
72
|
+
*/
|
|
73
|
+
getNextAdTagUrl(): Promise<string | null>;
|
|
74
|
+
/**
|
|
75
|
+
* Fires the Ezoic impression-event pixel for the most recently delivered tag.
|
|
76
|
+
* Call this on the IMA `STARTED` event. No-op natively when no tag has been
|
|
77
|
+
* delivered or after {@link destroy}.
|
|
78
|
+
*/
|
|
79
|
+
reportImpression(options?: EzoicInstreamImpressionOptions): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Cancels any in-flight load and releases the native controller for this id.
|
|
82
|
+
* A load in flight rejects. Safe to call multiple times.
|
|
83
|
+
*/
|
|
84
|
+
destroy(): Promise<void>;
|
|
85
|
+
}
|
|
86
|
+
//# sourceMappingURL=EzoicInstreamAd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EzoicInstreamAd.d.ts","sourceRoot":"","sources":["../../../src/EzoicInstreamAd.ts"],"names":[],"mappings":"AAEA,gDAAgD;AAChD,MAAM,WAAW,wBAAwB;IACvC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,4DAA4D;AAC5D,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,eAAe;IAC1B,oEAAoE;IACpE,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAElC;;;;OAIG;gBACS,gBAAgB,EAAE,MAAM,GAAG,MAAM;IAI7C;;;;;OAKG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC;IAOzD;;;;;OAKG;IACH,eAAe,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIzC;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,CAAC,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC;IAOzE;;;OAGG;IACH,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAGzB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
type LoadEvent = Readonly<{}>;
|
|
3
|
+
type ErrorEvent = Readonly<{
|
|
4
|
+
message: string;
|
|
5
|
+
code: CodegenTypes.Int32;
|
|
6
|
+
}>;
|
|
7
|
+
export interface NativeProps extends ViewProps {
|
|
8
|
+
adUnitIdentifier: string;
|
|
9
|
+
onLoad?: CodegenTypes.BubblingEventHandler<LoadEvent> | null;
|
|
10
|
+
onError?: CodegenTypes.BubblingEventHandler<ErrorEvent> | null;
|
|
11
|
+
onImpression?: CodegenTypes.BubblingEventHandler<LoadEvent> | null;
|
|
12
|
+
onAdClick?: CodegenTypes.BubblingEventHandler<LoadEvent> | null;
|
|
13
|
+
onOpen?: CodegenTypes.BubblingEventHandler<LoadEvent> | null;
|
|
14
|
+
onClose?: CodegenTypes.BubblingEventHandler<LoadEvent> | null;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: HostComponent<NativeProps>;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=EzoicOutstreamAdViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EzoicOutstreamAdViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/EzoicOutstreamAdViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE3E,KAAK,SAAS,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;AAC9B,KAAK,UAAU,GAAG,QAAQ,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,YAAY,CAAC,KAAK,CAAA;CAAE,CAAC,CAAC;AAE1E,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,gBAAgB,EAAE,MAAM,CAAC;IACzB,MAAM,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAC/D,YAAY,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAKnE,SAAS,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAChE,MAAM,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;IAC7D,OAAO,CAAC,EAAE,YAAY,CAAC,oBAAoB,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC;CAC/D;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -28,6 +28,10 @@ export interface Spec extends TurboModule {
|
|
|
28
28
|
showRewardedAd(adUnitIdentifier: string): Promise<EzoicRewardResult>;
|
|
29
29
|
loadInterstitialAd(adUnitIdentifier: string): Promise<void>;
|
|
30
30
|
showInterstitialAd(adUnitIdentifier: string): Promise<void>;
|
|
31
|
+
loadInstreamAd(adUnitIdentifier: number, contentUrl: string | null): Promise<string>;
|
|
32
|
+
getInstreamNextAdTagUrl(adUnitIdentifier: number): Promise<string | null>;
|
|
33
|
+
reportInstreamImpression(adUnitIdentifier: number, revenueUsd: number | null): Promise<void>;
|
|
34
|
+
destroyInstreamAd(adUnitIdentifier: number): Promise<void>;
|
|
31
35
|
addListener(eventName: string): void;
|
|
32
36
|
removeListeners(count: number): void;
|
|
33
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeEzoicAds.d.ts","sourceRoot":"","sources":["../../../src/NativeEzoicAds.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,YAAY,CAAC,EAAE,OAAO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,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3D,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;;AAED,wBAA6E"}
|
|
@@ -3,6 +3,7 @@ import { type EzoicConfig } from './NativeEzoicAds.js';
|
|
|
3
3
|
export type { EzoicConfig };
|
|
4
4
|
export { EzoicRewardedAd, type EzoicReward, type EzoicRewardedAdListeners, } from './EzoicRewardedAd.js';
|
|
5
5
|
export { EzoicInterstitialAd, type EzoicInterstitialAdListeners, } from './EzoicInterstitialAd.js';
|
|
6
|
+
export { EzoicInstreamAd, type EzoicInstreamLoadOptions, type EzoicInstreamImpressionOptions, } from './EzoicInstreamAd.js';
|
|
6
7
|
export declare const EzoicAds: {
|
|
7
8
|
initialize(config: EzoicConfig): Promise<void>;
|
|
8
9
|
setGDPRConsent(applies: boolean, consentString?: string): void;
|
|
@@ -46,4 +47,25 @@ export interface EzoicNativeAdViewProps {
|
|
|
46
47
|
* `{ width: '100%', height: 300 }`); the template lays out its assets inside.
|
|
47
48
|
*/
|
|
48
49
|
export declare function EzoicNativeAdView(props: EzoicNativeAdViewProps): import("react").JSX.Element;
|
|
50
|
+
export interface EzoicOutstreamAdError {
|
|
51
|
+
message: string;
|
|
52
|
+
code: number;
|
|
53
|
+
}
|
|
54
|
+
export interface EzoicOutstreamAdViewProps {
|
|
55
|
+
adUnitIdentifier: string | number;
|
|
56
|
+
style?: StyleProp<ViewStyle>;
|
|
57
|
+
onLoad?: () => void;
|
|
58
|
+
onError?: (error: EzoicOutstreamAdError) => void;
|
|
59
|
+
onImpression?: () => void;
|
|
60
|
+
onClick?: () => void;
|
|
61
|
+
onOpen?: () => void;
|
|
62
|
+
onClose?: () => void;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Renders an outstream video ad in an SDK-built player. Outstream video runs on
|
|
66
|
+
* its own (not inside host video content), so the SDK owns the player and this
|
|
67
|
+
* component only needs a size. Fills the bounds it is given by its RN style, so
|
|
68
|
+
* size it with `style` (e.g. `{ width: '100%', height: 200 }`).
|
|
69
|
+
*/
|
|
70
|
+
export declare function EzoicOutstreamAdView(props: EzoicOutstreamAdViewProps): import("react").JSX.Element;
|
|
49
71
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAuB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAuB,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAkB,CAAC;AAMpE,YAAY,EAAE,WAAW,EAAE,CAAC;AAC5B,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,wBAAwB,GAC9B,MAAM,sBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,KAAK,4BAA4B,GAClC,MAAM,0BAAuB,CAAC;AAC/B,OAAO,EACL,eAAe,EACf,KAAK,wBAAwB,EAC7B,KAAK,8BAA8B,GACpC,MAAM,sBAAmB,CAAC;AAE3B,eAAO,MAAM,QAAQ;uBACA,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;4BAGtB,OAAO,kBAAkB,MAAM,GAAG,IAAI;8BAGpC,MAAM,eAAe,MAAM,GAAG,IAAI;6BAGnC,OAAO,GAAG,IAAI;qBAGtB,OAAO,CAAC,OAAO,CAAC;CAGlC,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,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AAM,CAAC;IAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAC7B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACjD,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,yBAAyB,+BAuBpE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ezoic/react-native-sdk",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Ezoic Ads SDK for React Native (Prebid + Google Ad Manager banner, native, interstitial and
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "Ezoic Ads SDK for React Native (Prebid + Google Ad Manager banner, native, interstitial, rewarded, outstream and instream video ads).",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
7
|
"exports": {
|