iOS SDK Configuration options
Optional SDK flags
The SDK provides optional runtime configuration flags.
Logging
Use logMode to control how much the SDK writes to the system log.
magify.logMode = .debug
Critical notices are shown in every mode, so you will still see them in production builds. Verbose output is available only in .debug mode and can be monitored through the Xcode console.
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"
)
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.