capacitor-unity-ads
Version:
Capacitor plugin for Unity Ads integration with support for rewarded video and interstitial ads
56 lines (50 loc) • 1.89 kB
JavaScript
;
var core = require('@capacitor/core');
const UnityAds = core.registerPlugin('Unityads', {
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.UnityAdsWeb()),
});
class UnityAdsWeb extends core.WebPlugin {
async initialize(options) {
console.log('UnityAds Web: initialize', options);
// Web implementation not available for Unity Ads
throw new Error('Unity Ads is not available on web platform');
}
async loadRewardedVideo(options) {
console.log('UnityAds Web: loadRewardedVideo', options);
throw new Error('Unity Ads is not available on web platform');
}
async showRewardedVideo() {
console.log('UnityAds Web: showRewardedVideo');
throw new Error('Unity Ads is not available on web platform');
}
async isRewardedVideoLoaded() {
console.log('UnityAds Web: isRewardedVideoLoaded');
return { loaded: false };
}
async loadInterstitial(options) {
console.log('UnityAds Web: loadInterstitial', options);
throw new Error('Unity Ads is not available on web platform');
}
async showInterstitial() {
console.log('UnityAds Web: showInterstitial');
throw new Error('Unity Ads is not available on web platform');
}
async isInterstitialLoaded() {
console.log('UnityAds Web: isInterstitialLoaded');
return { loaded: false };
}
async setTestMode(options) {
console.log('UnityAds Web: setTestMode', options);
// No-op on web
}
async getVersion() {
console.log('UnityAds Web: getVersion');
return { version: 'web-mock' };
}
}
var web = /*#__PURE__*/Object.freeze({
__proto__: null,
UnityAdsWeb: UnityAdsWeb
});
exports.UnityAds = UnityAds;
//# sourceMappingURL=plugin.cjs.js.map