Initialize Appxiom plugin in Flutter
Detailed documentation is available at Appxiom Flutter Plugin Documentation.
Appxiom Flutter plugin must be initialized in your Flutter application to enable advanced monitoring and error reporting across both Android and iOS platforms. Initialization requires calling Ax.init() and Ax.initIOS() with your app credentials in the main() function of your Flutter app.
Obtaining App Credentials
Before initializing the plugin, you need to obtain your app credentials from the Appxiom dashboard:
- Log in to Appxiom Dashboard: Visit https://app.appxiom.com and sign in to your account
- Create or Select App: Create a new app using the
+icon at the top left corner or select an existing one from the dropdown menu - Settings Page: Go to the settings page
- Get Credentials: Copy your keys (
App KeyandPlatform Key) for Android, iOS, and iPadOS from the app settings page in Appxiom dashboard - Keep Secure: Store these keys securely in your project.
- Android: Pass App Key and Platform Key for Android initialization in Ax.init() function itself.
- iOS and iPadOS: Use info.plist for iOS and iPadOS to set the keys.
Setting iOS and iPad keys in info.plist
Open your Info.plist file and add the following keys:
<key>AX</key>
<dict>
<!-- Keys for iOS -->
<key>AppKey</key>
<string>ios_app_key</string>
<key>PlatformKey</key>
<string>ios_platform_key</string>
<!-- Keys for iPadOS -->
<key>AppKeyIpad</key>
<string>ipados_app_key</string>
<key>PlatformKeyIpad</key>
<string>ipados_platform_key</string>
</dict>
Replace ios_app_key, ios_platform_key, ipados_app_key, and ipados_platform_key with the actual keys from your Appxiom dashboard.
In case of SwiftUI projects, the
info.plistfile can be access viainfotab in your app target.
How to Initialize Appxiom plugin
Add the following code to your main.dart file with your app credentials:
import 'package:flutter/material.dart';
import 'package:appxiomcoreplugin/appxiomcoreplugin.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize Appxiom plugin with your app credentials
// Replace with your actual App Key and Platform Key from Appxiom dashboard
// Initialize Appxiom plugin for Android
Ax.init("android_app_key", "android_platform_key");
// Initialize for iOS and iPadOS
Ax.initIOS(); //Open your `Info.plist` file and add the iOS and iPadOS keys from Appxiom dashboard
runApp(MyApp());
}
Detailed documentation is available at Appxiom Flutter Plugin Documentation.
For more information, refer to the official Appxiom plugin documentation or contact support.
Need help? Visit our support page: support.appxiom.com