Configuration options
Optional SDK flags
The SDK provides optional runtime configuration flags.
Logging
Enable logging to help debug SDK integration and runtime behavior.
magify.isLoggingEnabled = true
When enabled, SDK activity can be monitored through the Xcode console.
We recommend enabling logging during development and disabling it in production builds unless additional diagnostics are required.
GeoIP support
Enable GeoIP support by setting:
magify.isGeoIPEnabled = true
GeoIP functionality may be used by backend services to improve content delivery and runtime targeting.
Client identity
The clientId parameter is immutable. It can be set only during initialization of the MagifyClient object.
After the client is created, the value of clientId cannot be changed.
magify = MagifyClient(
for: "Example iOS",
defaultConfigURL: configURL,
isSandbox: isSandbox,
clientId: "New_User_ID",
receiptObservationEnabled: false
)
Automatic clientId generation
If no value is provided for the parameter, a unique identifier is generated automatically.
This identifier is unique per the isSandbox value (one for true and another for false).
The generated identifier will be used consistently unless a custom clientId is provided.
Subscription status
Observe subscription state changes using:
magify.onSubscriptionStatusChanged = {
// Handle subscription state changes.
}
Applications can also synchronize subscription status manually after successful purchases or subscription state changes:
magify.subscriptionStatus = .active(isTrial: false)
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 and foreground synchronization.