private void InitCommands() { NavigatingCommand = new Command <WebNavigatingEventArgs>(e => { string code = RequestUtils.ExtractValueFromUrl(e.Url, URL_CODE_ATTRIBUTE_KEY); if (!string.IsNullOrWhiteSpace(code)) { e.Cancel = true; LoginAsync(code); } }); }
private void InitCommands() { NavigatingCommand = new Command <WebNavigatingEventArgs>(async e => { string token = RequestUtils.ExtractValueFromUrl(e.Url, URL_ACCESS_TOKEN_ATTRIBUTE_KEY); string state = RequestUtils.ExtractValueFromUrl(e.Url, URL_STATE_ATTRIBUTE_KEY); string error = RequestUtils.ExtractValueFromUrl(e.Url, URL_ERROR_ATTRIBUTE_KEY); if (!string.IsNullOrWhiteSpace(token) && _state == state) { e.Cancel = true; LoginAsync(token); return; } if (!string.IsNullOrWhiteSpace(error)) { e.Cancel = true; await ShowMessage(ViewModelConstants.LOGIN_WITH_FACEBOOK_FAILED_MESSAGE); _pageNavigator.GoBack(); } }); }