Configuration options

Optional SDK flags

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

magify.turnOffGeoIP = true
magify.isLoggingEnabled = true

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

AppsFlyer

Popups

AghanimOrderStatus

Introduction

Products

Campaigns