@wscsports/blaze-rtn-gam-ads
Version:
WSC Sports Blaze GAM Ads component for React Native
41 lines (36 loc) • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BlazeGAM = void 0;
var _reactNative = require("react-native");
var _BlazeGAMDelegate = require("./BlazeGAMDelegate");
const {
RTNBlazeGAM
} = _reactNative.NativeModules;
const BlazeGAMNativeModule = RTNBlazeGAM;
// This wrapper is hiding the internal interface that works with the native module, and serves as additional layer to add custom logic.
class BlazeGAMWrapper {
enableCustomNativeAds(options) {
BlazeGAMNativeModule.enableCustomNativeAds(options);
_BlazeGAMDelegate.BlazeGlobalDelegateHelper.registerDelegate(options.delegate);
}
disableCustomNativeAds() {
BlazeGAMNativeModule.disableCustomNativeAds();
}
setCustomGAMTargetingProperties(props = {}) {
BlazeGAMNativeModule.setCustomGAMTargetingProperties(props);
}
// Singleton instance
// Private constructor for singleton
constructor() {}
// Method to get singleton instance
static getInstance() {
if (!this.instance) {
this.instance = new BlazeGAMWrapper();
}
return this.instance;
}
}
const BlazeGAM = exports.BlazeGAM = BlazeGAMWrapper.getInstance();
//# sourceMappingURL=NativeBlazeGAM.js.map