Example #1
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            try
            {
                var requestToken = StorageHelper.Retrieve("request_token");

                if (requestToken != null)
                {
                    var accessToken = await _pocketOauth.GetAccessTokenAsync(requestToken);

                    StorageHelper.Save("access_token", accessToken);

                    TokenContent.Text = String.Format("Request token = {0}, Access token = {1}", requestToken,
                                                      accessToken);

                    _pocketClient = new PocketClient("11138-795ce1635b4487cac002aa0b", accessToken);

                    var pocketObject = await _pocketClient.GetAllUnreadAsync();

                    TokenContent.Text = pocketObject.First().Excerpt;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Example #2
0
        public async Task Oauth_AccessToken_OK()
        {
            var          pocket       = new PocketOauth("consumer_key", "rediret_uri");
            const string requestToken = "request_token";

            var token = await pocket.GetAccessTokenAsync(requestToken);

            Assert.IsNotNull(token);
        }