- Open your project to add the
AXAiOSBindings_MAUI.dllpackage. - Right-click on Dependencies, select Manage NuGet Packages, and search the AXAiOSBindings_MAUI.dll file from the list in the Nuget packages window under the nuget.org Package source and then click Add Package.
- Add the
<app_name>_camdo.plistfile to your project as a bundle resource For example:<ItemGroup> <BundleResource Include="xxx_camdo.plist" /> </ItemGroup>
- Add the following permissions to your application
Info.plist, if not already present.<key>NSLocationWhenInUseUsageDescription</key> <string>This allows us to track and gather analytic data for improving the app experience.</string> <key>NSLocationAlwaysUsageDescription</key> <string>This allows us to track and gather analytic data for improving the app experience.</string> <key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <string>This allows us to track and gather analytic data for improving the app experience.</string>
Initialise the CAMobileAppAnalytics SDK in MauiProgram.cs in iOS FinishedLaunching event
- Import AXAiOSBindings_MAUI
#if IOS using AXAiOSBindings_MAUI; #endif
- Initialise the SDK
.ConfigureLifecycleEvents(events => { #if IOS events.AddiOS(iOS => iOS.FinishedLaunching((app, launchOptions) => { AXAiOSBindings_MAUI.CAMDOReporter.InitializeSDKWithOptions(AXAiOSBindings_MAUI.SDKOptions.SDKLogLevelVerbose, (_, __) => {LogEvent("SDK initialized successfully"); }); return true; })); #endif
Use AXAiOSBindings_MAUI.CAMDOReporter to call custom APIs in your project.
For example:
AXAiOSBindings_MAUI.CAMDOReporter.SetCustomerId("Test");