Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS 6 Social framework not going to settings or no alert
    primarykey
    data
    text
    <p>I'm trying to implement the new social framework in iOS6, and have it working, except for 2 weird problems. If I've enabled the services I'm interested in (say... FaceBook), then it works fine. However, if the accounts are deleted from the settings panel (let's say FaceBook, to be consistent), then I get differing, and frustrating behaviors in the simulator and the device.</p> <p>Here's the relevant code in my view controller:</p> <pre><code>//Method for FaceBook - (IBAction)doFacebook:(id)sender{ //check to see if facebook account exists if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) { // Create the view controller defined in the .h file fb=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; // make the default string NSString *FBString= [NSString stringWithFormat:@"%@\r via #GibberishGenerator", gibText.text]; [fb setInitialText:FBString]; // show the controller [self presentViewController:fb animated:YES completion:nil]; } } </code></pre> <p>And here's the weird behavior when firing off the above method:</p> <p>In <strong>the simulator (version 6.0 (358.4</strong>) I get the dialog informing me that I haven't set up any faceBook accounts with "Settings" and "Cancel" buttons. Hitting "Settings" just dismisses the dialog, but doesn't take me to the settings panel.</p> <p>On my <strong>iPhone 4s running 6.01,</strong> hitting the button that triggers the method results in... nothing. In other words, I get no dialog informing me that I have to set up a FaceBook account.</p> <p>Thanks in advance for your help.</p> <hr> <h2>OK... Here's the fix:</h2> <p>Here's my new implementation, based on user1734802's helpful comment. </p> <pre><code>//Method for FaceBook - (IBAction)doFacebook:(id)sender{ // Create the view controller defined in the .h file fb=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook]; // make the default string NSString *FBString= [NSString stringWithFormat:@"%@\r via #GibberishGenerator", gibText.text]; [fb setInitialText:FBString]; // show the controller [self presentViewController:fb animated:YES completion:nil]; } </code></pre> <p>At some point I expect </p> <pre><code> [SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) </code></pre> <p>to actually work correctly (triggering the automatic dialog, and taking you to settings), so I actually just commented it out in my code.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload