Android SDK Сonfiguration options

Optional SDK flags

Optional SDK flags should be configured before calling initialSetup().

magify.turnOffGeoIP = true
magify.isLoggingEnabled = true

Logging

Debug logging is disabled by default. Critical warnings and errors are always written to Logcat under the [Magify] tag.

Set isLoggingEnabled = true to turn on debug logging for all scopes:

magify.isLoggingEnabled = true

To limit the output, enable only the scopes you need:

magify.isLoggingEnabled = true
magify.disableAllLoggingScopes()

magify.enableLoggingScope(LoggingScope.Network)
magify.enableLoggingScope(LoggingScope.Purchases)

Available scopes: LTO, Scheduler, Storage, Content, Features, Analytics, Network, Purchases, Migration, AppState, Aghanim.

Client identity

To use a specific clientId, provide it during SDK initialization.

Otherwise, the system generates and stores one automatically.

val config = MagifyConfig(
    ...
    userId = "custom_client_id",
    ...
)

Changing clientId

You cannot overwrite the current live or sandbox clientId.

To initialize the SDK with a new clientId, perform the following steps:

  1. Call magify.resetState().
  2. Restart the application so that the Application class is recreated.
  3. Initialize the SDK with the new clientId.
  4. Restore optional runtime fields.

Reset the SDK state:

magify.resetState()

Initialize the SDK with a new clientId:

val config = MagifyConfig(
    applicationName = "android-application",
    defaultConfig = "Magify-Config.json",
    isSandbox = false,
    userId = "new_client_id"
)

magify = Magify.createInstance(androidApp, config)

Restore optional fields:

magify.subscriptionStatus = SubscriptionState.ACTIVE_PAID
magify.inAppStatus = InAppStatus.PURCHASED
magify.mediaSource = MediaSource(
    network = "appsflyer",
    campaign = "ua_01",
    adGroup = "us"
)

Subscription and purchase status

Synchronize subscription and in-app purchase status with Magify:

magify.subscriptionStatus = SubscriptionState.ACTIVE_PAID
magify.inAppStatus = InAppStatus.PURCHASED

Next step

Now that the SDK is configured, you can proceed to the SDK Lifecycle section to learn how the SDK behaves during application runtime.

Related articles

Flutter SDK Integration with other SDK

ProductIdType

MagifyConfig

iOS SDK Releases

External validation

PurchaseInfo