Quantcast
Channel: Tweetinvi a friendly Twitter C# library
Viewing all articles
Browse latest Browse all 4126

New Post: Async problem

$
0
0
Hi there thanks for the API, got it working after couple of hours and have so far managed to get my phone app to tweet with a picture (of which the user has taken) on the phone.

This is great so far, but my next thing I need to do is to retrieve all the tweets from a users timeline.

The async call for writing tweets work fine on my windows phone app
TweetAsync.PublishTweetWithMedia("<< Description: " + textbox_Description.Text + "<< Coords: Lat = " +lat.ToString() + ", long =  " +longi.ToString(), imageBytes);
However when trying to use this code (called when user pushes a button), I get an error with the asyncronous call "The await operator can only be used with an async method"
        private void getUserTimeline()
        {

            // Both these async calls are not recognised, if I do not use async calls for these app hangs
            var timeline = await user.GetUserTimelineAsync();
            var user = await UserAsync.GetLoggedUser();


            foreach (var tweet in timeline)
            {
                MessageBox.Show(tweet.Text);

            }
        }
These are my TweetInvi references
using Tweetinvi;
using Tweetinvi.Core.Helpers;
using Tweetinvi.Core.Interfaces;
using Tweetinvi.Logic;
using Tweetinvi.Core.Interfaces.DTO;
using System.Threading.Tasks;

Viewing all articles
Browse latest Browse all 4126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>