Question

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.

Was it helpful?

Solution

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?

OTHER TIPS

Unfortunatly you can't check if the user is correctly logged. The facebook password can be incorrect and the method (isAvailableForServiceType) returns true

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top