UIActivityViewController Facebook shared text

I am trying to post on Facebook / Twitter with pre-filled text using UIActivityViewController. But I can’t fill in the pre-filled text, below is my sample code.

UIImage* shareImage =  [self saveVersionGraphicsAndThumbnailImage:self.drawingView];
NSString* message = @"My post - ";
NSArray* shareItems = @[message, shareImage];

UIActivityViewController * avc = [[UIActivityViewController alloc] initWithActivityItems:shareItems applicationActivities:nil];

if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
    UIPopoverPresentationController *presentationController = [avc popoverPresentationController];
    presentationController.sourceView = sender;
}
[self presentViewController:avc animated:YES completion:nil];

Help solve this problem, thanks in advance.

+4
source share
2 answers

It would seem that Facebook no longer wants developers to pre-populate messages with text. From https://developers.facebook.com/docs/sharing/ios#ios-integration :

iOS Facebook, 2.3, , . , shareline , . , , SDK:

API- iOS ( ), iOS, SDK Facebook. native Share , Facebook iOS 6+. API , SDK Facebook.

+4

, . shareitem

NSArray * activityItems = @[[NSString stringWithFormat:@"My Post - "], shareImage];

.

+1

All Articles