capacitor-levelplay/dist/plugin.js

89 lines
2.9 KiB
JavaScript

var capacitorLevelPlay = (function (exports, core) {
'use strict';
/**
* Public demo app keys and ad unit ids from Unity's official LevelPlay sample apps
* (https://github.com/ironsource-mobile/Mediation-Demo-Apps: `Android/Kotlin/.../DemoActivity.kt` and
* `iOS/Swift SPM/LevelPlayDemo/DemoViewController.swift`). They serve test ads and are safe for development only.
* Replace them with your own ids from the LevelPlay dashboard before release.
*/
const LEVELPLAY_DEMO = {
android: {
appKey: '25b63cf85',
rewarded: 'syz3d8ekts22q0or',
interstitial: 'h3xw38h9214adgxo',
},
ios: {
appKey: '8545d445',
rewarded: 'qwouvdrkuwivay5q',
interstitial: 'wmgt0712uuux8ju4',
},
};
const LevelPlay = core.registerPlugin('LevelPlay', {
web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.LevelPlayWeb()),
});
/**
* Web stub. LevelPlay has no web SDK: init rejects with `unimplemented`, ads are never ready and every show resolves
* as "not shown" so callers can treat the web like a no-fill platform without special casing.
*/
class LevelPlayWeb extends core.WebPlugin {
async initialize(_options) {
throw this.unimplemented('LevelPlay is not available on the web.');
}
async getSdkVersion() {
return { sdkVersion: 'web' };
}
async setConsent(_options) {
/* nothing to forward */
}
async setMetaData(_options) {
/* nothing to forward */
}
async requestTrackingAuthorization() {
return { status: 'unavailable' };
}
async getTrackingAuthorizationStatus() {
return { status: 'unavailable' };
}
async loadRewarded(_options) {
/* never fills */
}
async showRewarded(_options) {
return Object.assign({}, LevelPlayWeb.NO_FILL);
}
async loadInterstitial(_options) {
/* never fills */
}
async showInterstitial(_options) {
return Object.assign({}, LevelPlayWeb.NO_FILL);
}
async isReady() {
return { ready: false };
}
async launchTestSuite() {
throw this.unimplemented('LevelPlay is not available on the web.');
}
async validateIntegration() {
/* nothing to validate */
}
}
LevelPlayWeb.NO_FILL = {
shown: false,
rewarded: false,
error: { code: -1, message: 'LevelPlay is not available on the web' },
};
var web = /*#__PURE__*/Object.freeze({
__proto__: null,
LevelPlayWeb: LevelPlayWeb
});
exports.LEVELPLAY_DEMO = LEVELPLAY_DEMO;
exports.LevelPlay = LevelPlay;
return exports;
})({}, capacitorExports);
//# sourceMappingURL=plugin.js.map