예제 #1
0
        public static async Task <bool> TryLoginAsync()
        {
            ServiceLocator.Instance.Register <IDataStore <Item>, AzureDataStore>();
            var authentication = new SocialAuthenticator();

            authentication.ClearCookies();

            var dataStore = ServiceLocator.Instance.Get <IDataStore <Item> >() as AzureDataStore;
            await dataStore.InitializeAsync();

            var user = await authentication.LoginAsync(dataStore.MobileService, dataStore.AuthProvider, App.LoginParameters);

            if (user == null)
            {
            }

            Settings.AuthToken = user?.MobileServiceAuthenticationToken ?? string.Empty;
            Settings.UserId    = user?.UserId ?? string.Empty;
            return(true);
        }
예제 #2
0
 private SocialManager()
 {
     authenticator = new SocialAuthenticator(new QueueActionRunnerGroup(backgroundQueueActionRunner, foregroundQueueActionRunner));
     init();
 }
예제 #3
0
 private SocialManager()
 {
     authenticator = new SocialAuthenticator(new QueueActionRunnerGroup(backgroundQueueActionRunner, foregroundQueueActionRunner));
     init();
 }