capacitor-firebase-kit
Version:
Provider-less Firebase Kit - Universal Firebase services integration for React, React Native, and Capacitor apps
229 lines • 8.86 kB
JavaScript
import { WebPlugin } from '@capacitor/core';
import { FirebaseKitWeb } from './web';
/**
* Web plugin implementation that routes method calls to appropriate Firebase services.
* This class acts as a bridge between the Capacitor plugin system and the Firebase Web SDK.
*
* @internal
* @since 1.0.0
*/
export class FirebaseKitPluginImplementation extends WebPlugin {
/**
* Initialize the plugin implementation with Firebase Web SDK.
*
* @since 1.0.0
*/
constructor() {
super();
this.implementation = new FirebaseKitWeb();
}
// Proxy methods to route calls to the appropriate service
// App Check methods
async appCheckInitialize(options) {
return this.implementation.appCheck.initialize(options);
}
async appCheckGetToken(options) {
return this.implementation.appCheck.getToken(options);
}
async appCheckSetTokenAutoRefreshEnabled(options) {
return this.implementation.appCheck.setTokenAutoRefreshEnabled(options);
}
async appCheckAddListener(options) {
return this.implementation.appCheck.addListener(options.eventName, options.listenerFunc);
}
// AdMob methods
async adMobInitialize(options) {
return this.implementation.adMob.initialize(options);
}
async adMobRequestConsentInfo(options) {
return this.implementation.adMob.requestConsentInfo(options);
}
async adMobShowConsentForm() {
return this.implementation.adMob.showConsentForm();
}
async adMobResetConsentInfo() {
return this.implementation.adMob.resetConsentInfo();
}
async adMobSetRequestConfiguration(options) {
return this.implementation.adMob.setRequestConfiguration(options);
}
async adMobShowBanner(options) {
return this.implementation.adMob.showBanner(options);
}
async adMobHideBanner() {
return this.implementation.adMob.hideBanner();
}
async adMobRemoveBanner() {
return this.implementation.adMob.removeBanner();
}
async adMobLoadInterstitial(options) {
return this.implementation.adMob.loadInterstitial(options);
}
async adMobShowInterstitial() {
return this.implementation.adMob.showInterstitial();
}
async adMobLoadRewarded(options) {
return this.implementation.adMob.loadRewarded(options);
}
async adMobShowRewarded() {
return this.implementation.adMob.showRewarded();
}
async adMobLoadRewardedInterstitial(options) {
return this.implementation.adMob.loadRewardedInterstitial(options);
}
async adMobShowRewardedInterstitial() {
return this.implementation.adMob.showRewardedInterstitial();
}
async adMobAddListener(options) {
return this.implementation.adMob.addListener(options.eventName, options.listenerFunc);
}
// Crashlytics methods
async crashlyticsCrash() {
return this.implementation.crashlytics.crash();
}
async crashlyticsForceCrash(options) {
return this.implementation.crashlytics.forceCrash(options);
}
async crashlyticsLog(options) {
return this.implementation.crashlytics.log(options);
}
async crashlyticsLogException(options) {
return this.implementation.crashlytics.logException(options);
}
async crashlyticsSetUserId(options) {
return this.implementation.crashlytics.setUserId(options);
}
async crashlyticsSetCustomKeys(options) {
return this.implementation.crashlytics.setCustomKeys(options);
}
async crashlyticsSetCrashlyticsCollectionEnabled(options) {
return this.implementation.crashlytics.setCrashlyticsCollectionEnabled(options);
}
async crashlyticsIsCrashlyticsCollectionEnabled() {
return this.implementation.crashlytics.isCrashlyticsCollectionEnabled();
}
async crashlyticsDeleteUnsentReports() {
return this.implementation.crashlytics.deleteUnsentReports();
}
async crashlyticsSendUnsentReports() {
return this.implementation.crashlytics.sendUnsentReports();
}
async crashlyticsRecordBreadcrumb(options) {
return this.implementation.crashlytics.recordBreadcrumb(options);
}
// Performance methods
async performanceInitialize(options) {
return this.implementation.performance.initialize(options);
}
async performanceSetPerformanceCollectionEnabled(options) {
return this.implementation.performance.setPerformanceCollectionEnabled(options);
}
async performanceIsPerformanceCollectionEnabled() {
return this.implementation.performance.isPerformanceCollectionEnabled();
}
async performanceStartTrace(options) {
return this.implementation.performance.startTrace(options);
}
async performanceStopTrace(options) {
return this.implementation.performance.stopTrace(options);
}
async performanceIncrementMetric(options) {
return this.implementation.performance.incrementMetric(options);
}
async performanceSetMetric(options) {
return this.implementation.performance.setMetric(options);
}
async performanceGetMetric(options) {
return this.implementation.performance.getMetric(options);
}
async performancePutAttribute(options) {
return this.implementation.performance.putAttribute(options);
}
async performanceGetAttributes(options) {
return this.implementation.performance.getAttributes(options);
}
async performanceRemoveAttribute(options) {
return this.implementation.performance.removeAttribute(options);
}
async performanceStartScreenTrace(options) {
return this.implementation.performance.startScreenTrace(options);
}
async performanceStopScreenTrace(options) {
return this.implementation.performance.stopScreenTrace(options);
}
async performanceRecordNetworkRequest(options) {
return this.implementation.performance.recordNetworkRequest(options);
}
// Analytics methods
async analyticsInitialize(options) {
return this.implementation.analytics.initialize(options);
}
async analyticsSetCollectionEnabled(options) {
return this.implementation.analytics.setCollectionEnabled(options);
}
async analyticsSetCurrentScreen(options) {
return this.implementation.analytics.setCurrentScreen(options);
}
async analyticsLogEvent(options) {
return this.implementation.analytics.logEvent(options);
}
async analyticsSetUserProperty(options) {
return this.implementation.analytics.setUserProperty(options);
}
async analyticsSetUserId(options) {
return this.implementation.analytics.setUserId(options);
}
async analyticsSetSessionTimeoutDuration(options) {
return this.implementation.analytics.setSessionTimeoutDuration(options);
}
async analyticsGetAppInstanceId() {
return this.implementation.analytics.getAppInstanceId();
}
async analyticsResetAnalyticsData() {
return this.implementation.analytics.resetAnalyticsData();
}
async analyticsSetConsent(options) {
return this.implementation.analytics.setConsent(options);
}
async analyticsSetDefaultEventParameters(options) {
return this.implementation.analytics.setDefaultEventParameters(options);
}
// Remote Config methods
async remoteConfigInitialize(options) {
return this.implementation.remoteConfig.initialize(options);
}
async remoteConfigSetDefaults(options) {
return this.implementation.remoteConfig.setDefaults(options);
}
async remoteConfigFetch(options) {
return this.implementation.remoteConfig.fetch(options);
}
async remoteConfigActivate() {
return this.implementation.remoteConfig.activate();
}
async remoteConfigFetchAndActivate(options) {
return this.implementation.remoteConfig.fetchAndActivate(options);
}
async remoteConfigGetValue(options) {
return this.implementation.remoteConfig.getValue(options);
}
async remoteConfigGetAll() {
return this.implementation.remoteConfig.getAll();
}
async remoteConfigGetSettings() {
return this.implementation.remoteConfig.getSettings();
}
async remoteConfigSetSettings(options) {
return this.implementation.remoteConfig.setSettings(options);
}
async remoteConfigEnsureInitialized() {
return this.implementation.remoteConfig.ensureInitialized();
}
async remoteConfigReset() {
return this.implementation.remoteConfig.reset();
}
async remoteConfigAddListener(options) {
return this.implementation.remoteConfig.addListener(options.eventName, options.listenerFunc);
}
}
//# sourceMappingURL=plugin-implementation.js.map