Table of Contents

Namespace Titipi.MocaLib2

Classes

AdMobModule

Wraps the Google Mobile Ads (AdMob) Unity SDK for Banner, Interstitial, and Rewarded ad formats. Supported on Android, iOS, and the Unity Editor; on any other platform every method logs its entry and no-ops, returning its default value.

AdMobModuleConfig
AdMobPlatformConfig
AdjustModule

Wraps the Adjust SDK for attribution tracking, event reporting, ad revenue, and purchase validation. Supported on Android, iOS, and the Unity Editor; on any other platform every method logs its entry and no-ops, returning its default value.

AdjustModuleConfig
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. Supported on Android, iOS, and the Unity Editor; on any other platform every method logs its entry and no-ops, returning its default value (the MAX SDK only exists on those platforms, so every body that touches it is gated on the same allowlist).

AppLovinModuleConfig
AppLovinPlatformConfig
AppRatingModule

Displays a store rating prompt. The prompt is shown at most once per install — the shown state is persisted in PlayerPrefs.

AppRatingModuleConfig
AppUpdateModule

Version gate and update prompt. Android asks Google Play In-App Updates whether this specific device can update right now (rollout- and CDN-aware, no version strings involved); iOS compares the running version against the store version mirrored into Remote Config. Both platforms share a Remote Config min_supported_version force gate — see AppUpdateModuleConfig for the key contract.

AppUpdateModuleConfig

Config for AppUpdateModule. The Remote Config key is platform-specific because the two stores' version lines can diverge; each platform reads only its own key:

// android_app_update_info
{"disabled":false,"min_supported_version":"26.6.1"}

// ios_app_update_info
{"disabled":false,"latest_version":"26.6.4","min_supported_version":"26.6.1","store_url":"https://apps.apple.com/app/idXXXXXXXXX"}

Create both keys by hand once in the Firebase console. latest_version is best kept current by a scheduled job that mirrors the live App Store version into it (recommended — automation can't forget a release), but editing it by hand after each release also works when no job is set up; every other field is hand-written. Android needs no latest_version/store_url — Play In-App Updates answers availability itself.

AppsFlyerModule

Wraps the AppsFlyer Unity SDK for install attribution, event tracking, ad revenue, and purchase validation. Supported on Android, iOS, and the Unity Editor; on any other platform every method logs its entry and no-ops, returning its default value.

AppsFlyerModuleConfig
ByteBrewModule

Wraps the ByteBrew SDK for custom event tracking and in-app purchase reporting. Supported on Android, iOS, and the Unity Editor; on any other platform every method logs its entry and no-ops, returning its default value.

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. Remote Config JSON uses snake_case keys ({"enabled":false,"banner_ad_unit_id":"…"}) mapped onto the PascalCase C# fields via a naming strategy, so the dashboard JSON stays idiomatic. Always available — no define guard required. When FirebaseModule is 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).

ConsentModule

Owns the user-privacy consent that must be resolved before any third-party SDK is initialized. Today that means iOS App Tracking Transparency (ATT). Always available — no define guard required.

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.prefab by FirebaseInAppMessagingModule.

FacebookModule

Wraps the Facebook Unity SDK. Initializes the SDK and activates the app session so Facebook can attribute installs and track app events. Supported on Android, iOS, and the Unity Editor; on any other platform every method logs its entry and no-ops, returning its default value.

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. Supported on Android, iOS, and the Unity Editor; on any other platform every method logs its entry and no-ops, returning its default value.

FirebaseModuleConfig
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. Supported on Android, iOS, and the Unity Editor; on any other platform every method logs its entry and no-ops, returning its default value.

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. Supported on Android, iOS, and the Unity Editor; on any other platform every method logs its entry and no-ops, returning its default value.

GameVersionInfo
IAPModule

Wraps Unity IAP v5 for product registration, purchase flow, receipt validation, and restore. Uses the event-driven StoreController API. Supports an optional server-side validation step via IIapPurchaseVerificator. Confirm policy: an order is confirmed with the store only after it has been delivered to the game or proven invalid. On transient failures (verification timeout or error, no restore subscriber) the order is left pending, so the store redelivers it on the next launch — a purchase can be delayed but never lost.

IAPModuleConfig
IapPurchaseError

Purchase-flow error codes (verification codes live in IapVerificationError).

IapPurchaseException

Thrown by PurchaseProductAsync(string, Action) when a purchase flow fails. Check Reason instead of parsing Message: it holds a machine-readable code — a store failure reason (e.g. "UserCancelled"), an IapVerificationError code, or Deferred.

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.

MonoSingleton<T>
NetworkModule

Provides internet connectivity checking and background polling. Exposes a one-shot CheckInternetConnectionAvailableAsync() for on-demand checks, and a polling loop that fires OnInternetStatusChanged when reachability changes. The polling loop automatically pauses when the app is backgrounded.

PayloadAndroid
PlayerProfile

Firestore document representing a player, stored at users/{userId}. Automatically populated with device and app metadata on first save.

Receipt
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 memory-tier classification, and IAP receipt parsing. Always available — no define guard required.

Structs

AdImpressionData
AppUpdateCheckResult

Result of CheckAsync().

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

AppUpdateAvailability

How the running build compares to what the store currently offers.

AppUpdateSeverity

What the game should do about the check result.

DeviceMemoryTier

Coarse device memory tier derived from system RAM. See GetDeviceMemoryTier(int, int). Deliberately named for what it measures: a low-RAM device is not necessarily "low-end" — its CPU/GPU may be perfectly capable.

FIAMButtonActionType

The action to perform when a FIAM popup button is tapped.