In the iOS bootstrapper, we will have configurations that are specific to the iOS app. To create an iOS app, follow these steps:
- In the iOS project, create a new class called Bootstrapper.
- Make the new class inherit from MeTracker.Bootstrapper.
- Write the following code:
using Autofac; using MeTracker.iOS.Services; using MeTracker.Services; namespace MeTracker.iOS {
public class Bootstrapper : MeTracker.Bootstrapper
{
public static void Execute()
{
var instance = new Bootstrapper();
}
protected override void Initialize()
{
base.Initialize();
ContainerBuilder.RegisterType<LocationTrackingService>()
.As<ILocationTrackingService>().SingleInstance();
}
}
}
- Go to AppDelegate.cs in the iOS project.
- Before the call to LoadApplication, in the FinishedLaunching method, call the Init method of the platform-specific bootstrapper, as shown in the following...