Documentation
Search…
Quickstart
Follow these steps to have a basic integration of the app's miles® SDK in your Xamarin application.
Xamarin Quickstart
Work In Progress

Conditions and minimum requirements

Minimum Android version: 4.1 (API 16) Minimum iOS version : 7.0 Minimum XCode version : 7

I. Installation

We publish the Xamarin SDK on Nuget under the name of XAPM

Adding NuGet packages

You need to add NuGet packages in 3 different places:
    Main project
    iOS project
    Android project
Main project
iOS
Android
In main project, add NuGet package :
    XAPM.Interface
Could not load image
In iOS project, add NuGet packages :
    XAPM.Interface
    XAPM.iOS.Impl
    XAPM.iOS.SDK
Could not load image
In Android project, add NuGet packages :
    XAPM.Interface
    XAPM.Droid.Impl
    XAPM.Droid.SDK
Could not load image

II. Configuration

No additional configuration required

III. Initialization

You will also need to initialize the SDK in 3 different places
Main project
iOS
Android
In main project, in file App.xaml.cs, init the SDK :
    partnerID : <PARTNER_ID>
    partnerSecret : <PARTNER_SECRET>
    appId : <APP_ID>
    baseUrl : <BASE_URL>
App.xaml.cs
1
public App()
2
{
3
InitializeComponent();
4
5
APM.Register();
6
APM.SetBaseUrl(<BASE_URL>);
7
APM.InitApp(<PARTNER_ID>, <PARTNER_SECRET>, <APP_ID>);
8
9
MainPage = new MainPage();
10
}
Copied!
In file MainPage.xaml.cs, call the method APM.RefreshSDK();
MainPage.xaml.cs
1
public MainPage()
2
{
3
InitializeComponent();
4
5
APM.RefreshSDK();
6
}
Copied!
In iOS project, in file AppDelegate.cs, init iOS SDK :
AppDelegate.cs
1
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
2
{
3
global::Xamarin.Forms.Forms.Init();
4
LoadApplication(new App());
5
6
XAPM.iOS.Impl.Initializer.Init();
7
8
return base.FinishedLaunching(app, options);
9
}
Copied!
In Android project, in file MainApplication.cs, init Android SDK :
MainApplication.cs
1
public override void OnCreate()
2
{
3
base.OnCreate();
4
RegisterActivityLifecycleCallbacks(this);
5
// A great place to initialize Xamarin.Insights and Dependency Services!
6
XAPM.Droid.Impl.Initializer.Init();
7
}
Copied!
You're done with the installation !
You should be able to see our SDK on your application.
And the banner appear !
Head to the next section to start integrating our SDK into your app's features.
Last modified 2yr ago