Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can I do if isAvailableForServiceType method returns NO

What can I do if isAvailableForServiceType method returns NO in case of Twitter, for example?

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) {
    // post message
} else {
    // show some additional screen
}

Can I somehow provide the user a standard login / register view or switch him to the iOS settings? If yes, how can I do it?

Thanks in advance.

like image 572
FrozenHeart Avatar asked Jul 18 '14 20:07

FrozenHeart


1 Answers

try this

    if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) {
        // 
    } else {
        SLComposeViewController *twitterSignInDialog = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
        [self presentViewController:twitterSignInDialog animated:NO completion:nil];
    }
like image 192
kas-kad Avatar answered Oct 13 '22 17:10

kas-kad