Das folgende Code-Snippet ist der Rückruf für eine Schaltfläche auf dem Bildschirm. Das Facebook-Blatt wird angezeigt, enthält jedoch keinen Text. Wenn Sie jedoch SLServiceTypeFacebook
durch SLServiceTypeTwitter
ersetzen, wird der ursprüngliche Text angezeigt. Ich verwende XCode 6.3.1 und iOS 8.3 auf einem iPhone 6. Vielen Dank im Voraus.setInitialText-Methode in SLComposeViewController iOS 8.3 zeigt keinen Text in Facebook-Blatt
-(IBAction)facebookButton:(id)sender
{
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
{
NSString* facebookText = @"Awesome App";
SLComposeViewController *fbPostSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
[fbPostSheet setInitialText:facebookText];
[self presentViewController:fbPostSheet animated:YES completion:nil];
}
else{
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"Unable to Connect to Facebook"
message:@"Make sure your device has an internet connection and you have your Facebook account setup in the Settings App"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alertView show];
}
}
Der ursprüngliche Text aus dem Dialogfacebook entfernt wird hat ein Problem, da Facebook die neueste Update werden. Du bist nicht allein. –
Mit dem gleichen Problem in ios8.2 konfrontiert und auch noch keine Lösung gefunden. –
Das gleiche Problem hier habe ich 8.0 –