Bug 31569 - ACAccountStore().Accounts does not contain Facebook Account
Summary: ACAccountStore().Accounts does not contain Facebook Account
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: XI 8.10
Hardware: PC Windows
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-07-02 08:32 UTC by Thorsten
Modified: 2016-01-29 14:13 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Thorsten 2015-07-02 08:32:59 UTC
While trying to add SSO Twitter and Facebook Login with SLComposeViewController, everything works fine with Twitter, but no Facebook Accounts are listet.

SLComposeViewController.IsAvailable(SLServiceType.Facebook) returns true.

Refering to https://developer.apple.com/library/ios/documentation/NetworkingInternet/Reference/SLComposeViewController_Class/index.html#//apple_ref/occ/clm/SLComposeViewController/isAvailableForServiceType IsAvailable should return false if no Accounts are listed.

Twitter and Facebook Accounts are correctly set in settings.

Also AccountStore.RequestAccess does not execute either on Simulator, nor Device.
Comment 1 Rolf Bjarne Kvinge [MSFT] 2015-07-03 02:30:31 UTC
Our code is just a thin binding on top of the Objective-C code, so this is probably not a bug in Xamarin.iOS.

But can you attach a test project we can use to reproduce the issue, we can verify if it's us or not.
Comment 3 Thorsten 2015-07-03 05:32:38 UTC
With a lot of try and error, I got it working.
AccountStore.Accounts is empty until RequestAccess was granted.

RequestAccess executed if it's thread is not the mainthread.

Next wired behavior: Accounts.Credentials is filled in case of Facebook, but empty in case of Twitter.
So I needed to create a dummy SLRequest, call GetPreparedUrlRequest().Headers["Authorization"] to access the oauth_token.

But with this token, I'm not able to authenticate against Azure MobileService, while the WAMS Login with Facebook token works fine.

I suggest updating http://developer.xamarin.com/guides/ios/platform_features/introduction_to_the_social_framework/ while the usage of Twitter and Facebook is not the same.
Comment 4 Thorsten 2015-07-08 05:37:15 UTC
Next bug: request.GetPreparedUrlRequest().Headers["Authorization"] does not contain access_token_secret to call Twitter APIs that require user context.
Comment 5 Thorsten 2015-07-08 05:38:49 UTC
Proof of concept submitted at 2015-07-03 03:15:45
Comment 6 Rolf Bjarne Kvinge [MSFT] 2016-01-29 14:13:16 UTC
The credentials is write-only due to privacy concerns, so this behavior is as designed (by Apple).

More information can be found here: http://stackoverflow.com/a/14912589/183422