react-native-ad-manager
Version:
A react-native component for Google Ad Manager banners, interstitials and native ads.
35 lines (33 loc) • 1.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.NativeAdsManager = void 0;
var _reactNative = require("react-native");
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
const {
CTKAdManageNativeManager
} = _reactNative.NativeModules;
class NativeAdsManager {
constructor(adUnitID, testDevices) {
_defineProperty(this, "isValid", void 0);
_defineProperty(this, "adUnitID", void 0);
// Indicates whether AdsManager is ready to serve ads
this.isValid = true;
this.adUnitID = adUnitID;
CTKAdManageNativeManager.init(adUnitID, testDevices);
}
static async registerViewsForInteractionAsync(nativeAdViewTag, clickable) {
return await CTKAdManageNativeManager.registerViewsForInteraction(nativeAdViewTag, clickable);
}
/**
* Set the native ad manager.
*/
toJSON() {
return this.adUnitID;
}
}
exports.NativeAdsManager = NativeAdsManager;
//# sourceMappingURL=NativeAdsManager.js.map