Flutter SDK Configuration options
This page documents every field of MagifyConfig, MagifyIosConfig and
MagifyAndroidConfig, the object passed to MagifyClient.instance.init (see
SDK Initialization).
MagifyConfig
Settings shared by both platforms.
MagifyIosConfig
iOS-only settings.
const MagifyIosConfig({
String? applicationName,
String? defaultConfig,
});
MagifyAndroidConfig
Android-only settings.
const MagifyAndroidConfig({
String? applicationName,
String? defaultConfig,
});
Per-platform overrides
applicationName and defaultConfig exist both at the top level and inside ios/android.
The platform-specific value, when set, wins for that platform only — this lets you point iOS
and Android at different dashboard applications and different bundled config assets while
sharing everything else:
const MagifyConfig(
applicationName: 'Example', // fallback for both platforms
defaultConfig: 'assets/default.json', // fallback for both platforms
isSandbox: false,
ios: MagifyIosConfig(
applicationName: 'Example iOS',
defaultConfig: 'assets/Magify-Config.json',
),
android: MagifyAndroidConfig(
applicationName: 'example-android',
defaultConfig: 'assets/default-config.json',
),
);
Neither field is required at the top level — you can set them entirely through ios/android
instead, which is useful when the two platforms have nothing in common:
const MagifyConfig(
isSandbox: false,
ios: MagifyIosConfig(
applicationName: 'Example iOS',
defaultConfig: 'assets/Magify-Config.json',
),
android: MagifyAndroidConfig(
applicationName: 'example-android',
defaultConfig: 'assets/default-config.json',
),
);
What's required is that the running platform end up with a value for both fields, from
either level. MagifyClient.instance.init throws an ArgumentError synchronously if it
doesn't — for example, a config that sets android.applicationName but no top-level
applicationName and no ios.applicationName fails on iOS, but is fine on Android.
Client identity
clientId is set once, at init time — there is no setter to change it afterwards. Related
runtime members, available once the SDK is initialized:
Next step
Continue to Integration with other SDK to feed attribution and purchase data from external SDKs into Magify.