Namespace Titipi.MocaLib2
Classes
- AdMobModule
Wraps the Google Mobile Ads (AdMob) Unity SDK for Banner, Interstitial, and Rewarded ad formats. Not supported on WebGL.
- AdjustModule
Wraps the Adjust SDK for attribution tracking, event reporting, ad revenue, and purchase validation.
- AppLovinModule
Wraps AppLovin MAX for Banner, Interstitial, and Rewarded ad formats. Each format is backed by a single ad unit that reloads automatically after every show and retries a failed load with exponential backoff (2→64s), per AppLovin's recommended integration. Not supported on WebGL.
- AppsFlyerModule
Wraps the AppsFlyer Unity SDK for install attribution, event tracking, ad revenue, and purchase validation.
- ByteBrewModule
Wraps the ByteBrew SDK for custom event tracking and in-app purchase reporting.
- CommonModule
Handles platform-level setup that must run before any third-party SDKs are initialized. Always available — no define guard required.
- ConfigModule
Resolves module config ScriptableObjects at runtime by overlaying Firebase Remote Config JSON onto the serialized asset. The asset supplies the defaults; a matching Remote Config key supplies partial or full overrides — letting you retune any config (ad unit ids, timeouts, feature flags, …) from the dashboard without shipping a new build. Always available — no define guard required. When
FirebaseModuleis disabled, the key is empty, or Remote Config has no value for it, resolution is a safe no-op that returns the asset's values unchanged (on a clone).
- FIAMPopupUI
MonoBehaviour that renders Firebase In-App Messaging popups. Must be in its own file named FIAMPopupUI.cs so Unity can discover it via Add Component. Instantiated at runtime from the
Resources/FIAMPopupUI.prefabby FirebaseInAppMessagingModule.
- FacebookModule
Wraps the Facebook Unity SDK. Initializes the SDK and activates the app session so Facebook can attribute installs and track app events.
- FirebaseInAppMessagingModule
Receives Firebase In-App Messaging campaigns via a native Android AAR plugin and dispatches them to game-side handlers. Image campaigns are also downloaded to local storage and cleaned up when their duration expires.
- FirebaseModule
Wraps the Firebase Unity SDK, providing Analytics, Crashlytics, Remote Config, and Cloud Messaging. Not supported on WebGL — all methods return early with a warning when compiled for that platform.
- FirestoreLeaderboardModule
Firebase Firestore-backed leaderboard with per-player score submission, top-N queries, and rank calculation via server-side aggregate counts. Firestore path:
leaderboards/{leaderboardName}/scores/{userId}. Requires FirebaseModule to be initialized first.
- FirestorePlayerProfileModule
Manages the current player's Firestore profile. Signs in anonymously on first run, caches the UID in PlayerPrefs for subsequent sessions, and stores/loads the profile document. Requires FirebaseModule to be initialized first.
- GameAnalyticsModule
Wraps the GameAnalytics SDK for design events and resource economy tracking.
- IAPModule
Wraps Unity IAP v5 for product registration, purchase flow, receipt validation, and restore. Uses the event-driven
StoreControllerAPI. Supports an optional server-side validation step via IIapPurchaseVerificator.
- IapVerificationError
Standardized error codes returned by the purchase verification flow.
- LeaderboardEntry
Represents a single player entry in a leaderboard.
- MocaLib2Config
Project-level MocaLib2 configuration. Open via MocaLib2 → Module Settings. Toggling any field automatically updates the project's Scripting Define Symbols.
- MocaLib2ModuleConfig
Base class for every MocaLib2 module config ScriptableObject. Carries the Remote Config key that Resolve<T>(T, string) uses to overlay dashboard-supplied JSON onto the asset's serialized defaults at runtime.
- PlayerProfile
Firestore document representing a player, stored at
users/{userId}. Automatically populated with device and app metadata on first save.
- RatingModule
Displays a store rating prompt. The prompt is shown at most once per install — the shown state is persisted in PlayerPrefs.
- ServerTimeModule
Fetches the current UTC time from the Titipi server API and exposes it as UtcNow. Resynchronizes every 10 minutes; uses a cached value from PlayerPrefs on cold starts so the time is available immediately without waiting for the first network round-trip.
- TestDevice
A named test device entry used in ad module configs to identify devices that receive test ads.
- ToggleableModuleConfig
Base class for configs of leaf SDK modules that support a runtime kill-switch. Foundational modules others depend on (Firebase, which bootstraps Remote Config; Network, a dependency of IAP) extend MocaLib2ModuleConfig directly and are never gated off.
- UtilityModule
Shared helpers used internally by all MocaLib2 modules. Provides structured logging, platform identification, app version access, locale detection, device-tier classification, and IAP receipt parsing. Always available — no define guard required.
Structs
- FIAMBannerMessage
A lightweight banner message delivered via Firebase In-App Messaging custom data.
- FIAMButton
Represents a tappable button in a FIAM popup, including its label, action, and optional metadata.
- FIAMImageMessage
An image-based in-app message with campaign metadata and action buttons.
- FIAMMetadata
Campaign-level metadata included with image and banner messages.
- FIAMModalMessage
A text-based in-app message with a title, body, and up to two action buttons.
Interfaces
- IFIAMPopupHandler
Implement this interface to handle button taps from FIAM popups. Pass the implementation to RegisterPopupHandler(IFIAMPopupHandler).
- IIapPurchaseVerificator
Implement this interface to plug in a custom server-side receipt validator. Set the implementation via SetPurchaseVerificator(IIapPurchaseVerificator).
Enums
- DeviceTier
Coarse device capability tier derived from system RAM. See GetDeviceTier(int, int).
- FIAMButtonActionType
The action to perform when a FIAM popup button is tapped.