capacitor-levelplay/dist/esm/web.js

52 lines
No EOL
1.5 KiB
JavaScript

import { WebPlugin } from '@capacitor/core';
/**
* 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.
*/
export class LevelPlayWeb extends 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' },
};
//# sourceMappingURL=web.js.map