예제 #1
0
 public async void CheckActivation()
 {
     await WithProgress(activityIndicator, async() => {
         var created = await StellarHelper.CheckAccountCreated(App.Locator.Profile.KeyPair);
         if (created)
         {
             var trusted = await StellarHelper.CheckTokenTrusted();
             if (trusted)
             {
                 App.Locator.Profile.Activated = true;
                 Application.Current.MainPage  = new MainPage();
             }
             else
             {
                 var added = await StellarHelper.AddTrustToken(App.Locator.Profile.KeyPair);
                 if (added)
                 {
                     App.Locator.Profile.Activated = true;
                     Application.Current.MainPage  = new MainPage();
                 }
                 else
                 {
                     ShowMessage("Error adding trust token");
                 }
             }
         }
         else
         {
             ShowMessage("Stellar account isn't created yet");
         }
     });
 }
예제 #2
0
        public async void CheckActivation()
        {
            var created = await StellarHelper.CheckAccountCreated(App.Locator.Profile.KeyPair);

            if (created)
            {
                var trusted = await StellarHelper.CheckTokenTrusted();

                if (trusted)
                {
                    App.Locator.Profile.Activated = true;

                    var navigationPage = new NavigationPage(new MainPage());

                    Application.Current.MainPage = navigationPage;

                    App.ShowLoading(false);
                }
                else
                {
                    var added = await StellarHelper.AddTrustToken(App.Locator.Profile.KeyPair);

                    if (added)
                    {
                        App.Locator.Profile.Activated = true;

                        var navigationPage = new NavigationPage(new MainPage());

                        Application.Current.MainPage = navigationPage;

                        App.ShowLoading(false);
                    }
                    else
                    {
                        App.ShowLoading(false);

                        ShowErrorMessage(AppResources.ErrorAddTrustToken);
                    }
                }
            }
            else
            {
                App.ShowLoading(false);

                ShowErrorMessage(AppResources.StellarAccountNotCreated);
            }
        }
예제 #3
0
        public async void CheckActivation()
        {
            Unfocus();

            var created = await StellarHelper.CheckAccountCreated(App.Locator.Profile.KeyPair);

            if (created)
            {
                var trusted = await StellarHelper.CheckTokenTrusted();

                if (trusted)
                {
                    App.Locator.Profile.Activated = true;

                    //var userInfo = await App.Locator.IdentityServiceClient.UserInfos();
                    //if (userInfo != null)
                    //{
                    //    App.Locator.Profile.SetCredentials(App.Locator.Profile.UserName,
                    //                                       userInfo.UserDetails.FullName, userInfo.UserDetails.PhoneNumber, userInfo.UserDetails.Address,
                    //                                       App.Locator.Profile.KeyPair.SecretSeed, App.Locator.Profile.Mnemonic);

                    //}

                    var page = new WaitingAccountCreationPage(true, true);

                    await Navigation.PushAsync(page, true);

                    App.ShowLoading(false);
                }
                else
                {
                    var page = new SMSVereficationPage();

                    await Navigation.PushAsync(page, true);

                    App.ShowLoading(false);
                }
            }
            else
            {
                var page = new SMSVereficationPage();

                await Navigation.PushAsync(page, true);

                App.ShowLoading(false);
            }
        }