Setting up the native platform projects

Now we move on to the native platform layer and prepare the iOS, Android, and Windows Phone projects. We are going to start with iOS; let's start by adding the NuGet packages required for the project:

  • Microsoft HTTP client libraries
  • Modern HTTP client
  • Autofac
  • Reactive extensions (main library)

Once we've added these packages to the project, let's open the AppDelegate file and add the same InitIoC function we used in the Locator project:

private void InitIoC() 
{ 
  IoC.CreateContainer(); 
  IoC.RegisterModule(new DroidModule()); 
  IoC.RegisterModule(new SharedModule(false)); 
  IoC.RegisterModule(new XamFormsModule()); 
  IoC.RegisterModule(new PortableModule()); 
  IoC.StartContainer(); 
} 

Then call this method before we load the ...

Get Xamarin Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.