❗️

Keys.cs is excluded from the Github repro

The API keys for Beer Drinkin are purposely excluded from the repo to ensure that the backend isn't compromised. You'll need to implement this yourself.

Example Keys.cs

public class Keys
{
    public static readonly string CrashReportingKey = "";

    //Azure App Service Url
    public static readonly string ServiceUrl = "";
    public static readonly string ServiceKey = "";

    //Social
    public static readonly string FacebookClientId = "";
        
    //Azure Search
    public static readonly string AzureSearchServiceName = "";
    public static readonly string AzureSearchApiKey = "";
}

1. Clone the repository

📘

Clone with HTTPS

Use Git or checkout with SVN using the web URL
https://github.com/MikeCodesDotNet/BeerDrinkin.git

The Beer Drinkin .NET SDK is included as part of the Beer Drinkin public repository which can be downloaded from GitHub.

2. Init the SDK

You're need to initialise the ViewModelBase in order to ensure the service locator has added implementations for all the required services.

//As close to Main() as possible. On iOS this is the first LOC in the Finished Launching override.
Core.ViewModels.ViewModelBase.Init();

//It's good pratice to now setup the Logger.
ServiceLocator.Instance.Add<ILogService, Logger>();

Understanding whats happening

The Init static method is responsible for registering our interface implementations for use within the entire SDK. If we were to replace a a service for Mock data or perhaps swap out the backend for Parse or AWS, we'd want to update the Init method to load the correct implementation.

public static void Init()
{
    //Azure Client
    ServiceLocator.Instance.Add<IAzureClient, AzureClient.AzureClient>();

    //Services
    ServiceLocator.Instance.Add<ISearchService, SearchService>();
    ServiceLocator.Instance.Add<ITrendsService, TrendsService>();
    ServiceLocator.Instance.Add<IBarcodeService, BarcodeService>(); 

    //DataStores
    ServiceLocator.Instance.Add<ICheckInStore, CheckInStore>();
    ServiceLocator.Instance.Add<IUserStore, UserStore>();
    ServiceLocator.Instance.Add<IWishStore, WishStore>();
    ServiceLocator.Instance.Add<IBeerStore, BeerStore>();
    ServiceLocator.Instance.Add<IRatingStore, RatingStore>();

    ServiceLocator.Instance.Add<IStoreManager, StoreManager>();
    ServiceLocator.Instance.Resolve<IStoreManager>().InitializeAsync();
}