2

I can share text to whatsapp/message app using

NSString* text=@"I am sharing this text";
NSArray* sharedArray=@[text];
UIActivityViewController * activityVC=[[UIActivityViewController alloc]initWithActivityItems:sharedArray applicationActivities:nil];
dispatch_async(dispatch_get_main_queue(), ^{
    // code here
    [self presentViewController:activityVC animated:YES completion:nil];//:activityVC animated:YES];

});

BUt the facebook messenger option is missing when I use this piece of code.

I have to add NSURL to the array, to make the facebook messenger option visible in the UIActivityController view:

NSString* text=@"I am sharing this text";
NSURL *myWebsite = [NSURL URLWithString:@"http://www.google.com"];
NSArray* sharedArray=@[text,myWebsite];
UIActivityViewController * activityVC=[[UIActivityViewController alloc]initWithActivityItems:sharedArray applicationActivities:nil];
dispatch_async(dispatch_get_main_queue(), ^{
    // code here
    [self presentViewController:activityVC animated:YES completion:nil];//:activityVC animated:YES];

});

But the issue is, the text is not shared in the facebook messenger, only the link gets shared to fb-messenger.

Is there a way to share text to fb-messenger from our app ?

Teja Nandamuri
  • 11,045
  • 6
  • 57
  • 109
  • In this way i also try for Whats app sharing only text. in iOS 9 but not share only text. this isuue is occur =>http://stackoverflow.com/questions/36760970/uiactivityviewcontroller-share-text-in-whats-app-and-all-sharing-option – ramesh bhuja Apr 21 '16 at 11:06

1 Answers1

3

According to Facebook's Platform Policy you unfortunately can no longer provide pre-fill text for sharing. This is why sharing with text silently fails. Who knows, if enough people complain they might change this, but I wouldn't hold your breath!

GraemeArthur
  • 507
  • 5
  • 13