joeisapro/MonoTouch.Fabric

Session is always NULL in my case.

Closed this issue · 2 comments

Thanks for your plugin. As I see it is the only way to get tokens from system twitter account, Xamarin's social just doesnt return any credentials.

I've tried a lot to make it work, but 'session' is always null.
I've done all this stuff with Fabric Mac app, got api key, put it into info.plist.
I have logged-in twitter account on iPhone, Xamarin's social see it and allows me to send tweets.
No matter if I use logInButton or logInWithCompletion from singletone - session is null every time.

I have this code in AppDelegate:

          var twitterKit = MonoTouch.Fabric.TwitterKit.Twitter.SharedInstance;
          twitterKit.StartWithConsumerKey ("replace_with_your_consumer_key",
                   "replace_with_your_consumer_secret");
          Fabric.With (new NSObject [] { twitterKit });

maybe I need to use some exact key and secret here? I've tried to put api_key and secret from Fabric but it isnt working too.

Can you please help me? What am I doing wrong?

Hi,

Are you running on a device or simulator?
I just tried it on my end and it does use the system twitter account when available.

It's hard to say what you're doing wrong without seeing more code. Could also be your twitter api key/secret.

Thanks for the answer!

I've tried to do it from scratch just using your sample app. I've opened it and changed only this place

twitterKit.StartWithConsumerKey("replace_with_your_consumer_key",
               "replace_with_your_consumer_secret");

to use twitter keys from Fabric website - and it wortks!
I didnt set api_key in info.plist and Fabric keys are registered for another bundle id - but it works!