Async problem

Jan 5, 2015 at 7:50 PM
Edited Jan 5, 2015 at 8:38 PM
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;


/edit

I've also tried runnning the process of aquiring a users tweets on a background thread to no avail, here is the code, an error gets thrown when I try to display the tweet.text contents in a text box
    private void bw_DoWork(object sender, DoWorkEventArgs e)
    {
        BackgroundWorker worker = sender as BackgroundWorker;

        ExceptionHandler.SwallowWebExceptions = false;

        var timeline = Timeline.GetHomeTimeline();
        if (timeline == null)
        {
            MessageBox.Show("Timeline Empty", "Error", MessageBoxButton.OK);
        }

        else
            {                    
               foreach (var tweet in timeline)
                  {
                      // simple text block on screen
                      tweet_text.Text = tweet.Text;
                  }
            }

       }