xamarin / Xamarin.Social

Xamarin.Social
Apache License 2.0
124 stars 74 forks source link

Twitter: Add Account freezes the App #38

Open tom-mayer opened 9 years ago

tom-mayer commented 9 years ago

Hi,

whenever I try to add an account on thw Xamain.Social Twitter UI, my app freezes and Android asks me whether to close or wait. Below is the minimal application based on the sample app. On the twitter side I added read and write permissions as well as checked "Allow this application to use 'Sign in with Twitter'". I filled in some arbitrary values for website/description and app name, I left callback URL blank.

Tested on Android 4.4 (Api Level 19).

    [Activity(Label = "Xamarin.Social Sample", MainLauncher = true)]
    public class MainActivity : Activity
    {
        private static readonly TwitterService Twitter = new TwitterService {
            ConsumerKey = "XXX",
            ConsumerSecret = "XXX"
            //CallbackUrl = new Uri("Callback URL from https://dev.twitter.com/apps")
        };

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            SetContentView(Resource.Layout.Main);

            Button twitterButton = FindViewById<Button>(Resource.Id.Twitter);
            twitterButton.Click += delegate {
                Item item = new Item {
                    Text = "I'm sharing great things using Xamarin!",
                };

                Intent intent = Twitter.GetShareUI(this, item, null);
                StartActivity(intent);
            };
        }
    }