1

I've implemented a Facebook post function in my app, where you can post the coordinates of your location on Facebook. It works fine in the iOS simulator, but when I try it on a real device (iPhone 5S) the post-box is empty and the post button is greyed out. Any ideas?

Here's my code:

SLComposeViewController *controllerFB = [[SLComposeViewController alloc] init];

controllerFB = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

NSString *theLocation = [NSString stringWithFormat:@"%f,%f", self.locationManager.location.coordinate.latitude, self.locationManager.location.coordinate.longitude];

[controllerFB setInitialText: theLocation];
[self presentViewController:controllerFB animated:YES completion:NULL];
Yomo
  • 175
  • 2
  • 15

1 Answers1

-1

Try to log in to Facebook in the Settings App on your iPhone

  • Are you sure you are signed to the Facebook account in the Settings App (not in the Facebook App)? I had the same problem before and it helped, but you can also have some other problem. – Darek Cieśla May 28 '15 at 22:02
  • There is problably a bug in the Facebook library. Did you see this thread? http://stackoverflow.com/questions/29925810/slservicetypefacebook-setinitialtext-is-not-working – Darek Cieśla May 28 '15 at 22:10
  • This is exactly your problem: http://openradar.appspot.com/radar?id=5061141176778752 it works on the simulator and does not work on the device – Darek Cieśla May 28 '15 at 22:13
  • Thanks for letting me know! :) – Yomo May 28 '15 at 22:21