Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

isAvailableForServiceType always returns true?

Simple line of code:

NSLog(@"Checking on Facebook: %d -- Checking on Twitter: %d",[SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook], [SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]);

Problem is that I'm getting 1 for both BOOLs. That's a problem because neither Twitter nor Facebook is setup with an account. This is on the simulator, so wondering if people have experienced this is happening on devices as well?

Documentation says that it should only return true if the service is available and at least one account is setup. But I'm getting true even without accounts setup. I'd like to use the values to hide some social posting buttons so would like this to work.

like image 275
Ryan Garcia Avatar asked Oct 10 '12 04:10

Ryan Garcia


2 Answers

Did you run the that in Simulator?

It seems isAvailableForServiceType always returns 1 in Simulator.

Maybe you can test it in ipad with IOS6.

like image 161
DzMonster Avatar answered Oct 29 '22 02:10

DzMonster


From my experience, I can confirm this is a bug in iOS Simulator 6.0. The isAvailableForServiceType method always returns TRUE for any service type on iOS Simulator.

On actual device running current iOS 6.0 it is working as expected.

like image 44
Miroslav Kovac Avatar answered Oct 29 '22 02:10

Miroslav Kovac