SDK Lifecycle
The SDK should be initialized once during application launch.
magify.setup()
After initialization, the SDK should be updated whenever the application becomes active.
magify.update()
For UIKit lifecycle integrations, this is commonly handled in:
func sceneDidBecomeActive(_ scene: UIScene) {
magify.update()
}
This allows the SDK to refresh runtime state, synchronize campaigns and features, and update client-related information whenever the application returns to the foreground.
Recommended integration flow
- Create a
MagifyClientinstance. - Configure the SDK.
- Call
setup()during application launch. - Call
update()whenever the application becomes active.
We recommend following this initialization and update sequence throughout the application lifecycle.
Next step
Now that the SDK lifecycle is configured, you can proceed to the Purchases section to learn how to synchronize subscription and purchase status.