Search code examples
iosslcomposeviewcontroller

SLComposeViewController. How to open device settings with adding Twitter or Facebook account


if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) 
{
    // Device is able to send a Twitter message
} 

How to handle option if device has not got Twitter or Facebook account to offer users open setting and add appropriate account? I mean that device will open setting page with Facebook/Twitter account settings automatically. Is this possible? Or I just need to show alert view and it is just one option to notify user about non logged in account.


Solution

  • Go ahead and display the SLComposeViewController for Twitter. The system will display an alert to the user for you with a settings button:

    enter image description here