Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In iOS 6, check if a person is logged in to a social network?

Is there a way to check if a user actually is logged in to facebook or twitter in the operating system.

The reason I want to do this is to fall back on sharing in the application by for example using facebooks SDK instead to share, without asking the user to log in again.

I actually thought that the code:

[SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook];

did exactly that, but apparently it only shows an alert if the user has not logged in.

This only occurs when the user does not have the Facebook app installed, is not logged in the operating system (in the settings), but is logged in to our application through the Facebook SDK.

like image 568
Joakim Engstrom Avatar asked Dec 11 '22 21:12

Joakim Engstrom


1 Answers

What you have works for me on device:

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {// do something only for logged in fb users} else {//do something else for non-fb users}

Are you trying on device or simulator?

like image 172
Edwin Iskandar Avatar answered Dec 28 '22 07:12

Edwin Iskandar