x3mads-loomit-capacitor
v1.0.0
Published
Loomit Ads Capacitor plugin for Android and iOS.
Downloads
798
Readme
x3mads-loomit-capacitor
Loomit Ads plugin for Capacitor apps.
Compatibility
- Capacitor:
^6.0.0 - Android: supported
- Android minimum SDK:
23(required bycom.x3mads.android.xmediator.mediation:applovin) - iOS: interstitial + rewarded supported in this package version
Install
pnpm add x3mads-loomit-capacitor
npx cap syncAndroid prerequisite (XMediator Maven repository)
XMediator Android artifacts are hosted in X3M's Maven repository. In your consuming app, ensure the repository is declared where Gradle resolves dependencies:
For Gradle projects using dependencyResolutionManagement (android/settings.gradle):
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
google()
mavenCentral()
maven { url = uri("https://android-artifact-registry.x3mads.com/maven") }
}
}For older Android Gradle setups (android/build.gradle), add it in your repositories block:
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://android-artifact-registry.x3mads.com/maven" }
}
}iOS prerequisite (XMediator pod source)
XMediator is distributed through X3M's CocoaPods specs repository. In your consuming app, ensure ios/App/Podfile includes:
source 'https://github.com/x3mads/podspecs.git'
source 'https://cdn.cocoapods.org/'Then install/update pods:
cd ios/App
pod install --repo-update
cd ../..
npx cap sync iosUsage
import { loomit } from 'x3mads-loomit-capacitor';
await loomit.init({
appKey: import.meta.env.PUBLIC_LOOMIT_APP_KEY,
testMode: true
});
await loomit.preloadInterstitial('YOUR_INTERSTITIAL_PLACEMENT');
await loomit.showInterstitial('YOUR_INTERSTITIAL_PLACEMENT');Integration Contract
The plugin is framework-agnostic. Keep your framework-specific config (SvelteKit, React, Vue) outside the package and pass runtime values:
appKey: required non-empty string.testMode: optional boolean.placementId: required for ad operations.adSpace: optional forshowInterstitial,showRewarded,showNative.
Events
The wrapper emits events with loomit.on(eventName, handler). Common events:
initialized,initializationFailedinterstitialLoaded,interstitialShown,interstitialClosed,interstitialFailedrewardedLoaded,rewardedShown,rewardEarned,rewardedClosed,rewardedFailedbannerLoaded,bannerShown,bannerHidden,bannerFailednativeLoaded,nativeShown,nativeHidden,nativeFailednativeError
