示例#1
0
        public override async Task OnStart()
        {
            if (_isHandlingStart)
            {
                return;
            }

            _isHandlingStart = true;

            await _userManager.LoadUser();

            Device.BeginInvokeOnMainThread(() =>
                                           MessagingCenter.Send(this, MessagingEvents.AppLoadFinished, GetMainPage()));

            if (App.Settings.SetupFinished)
            {
                await _friendsManager.LoadFriendsFromStore();

                await _contactsManager.LoadContactsAsync();

                await _friendsManager.ManageFriends(_contactsManager.Contacts);

                await _chatService.Connect();
            }

            _isHandlingStart = false;
        }
示例#2
0
        private async Task Start()
        {
            await _userManager.LoadUser();

            if (AuthenticationService.CanRequestToken())
            {
                await AuthenticationService.RequestToken(true);
            }

            Device.BeginInvokeOnMainThread(() =>
                                           MessagingCenter.Send(this, MessagingEvents.AppLoadFinished, GetMainPage()));

            if (App.Settings.SetupFinished)
            {
                await _friendsManager.LoadFriends();

                await _contactsManager.LoadContactsAsync();

                await _friendsManager.ManageFriends(_contactsManager.Contacts);

                await _chatService.Connect();
            }
        }