6

After updating to iOS 8.3 the text is not inserted into the share dialog

i use a standard

UIActivityViewController *vc = [[UIActivityViewController alloc] initWithActivityItems:items applicationActivities:applicationActivities];
NSArray *excludeActivities = @[UIActivityTypeAssignToContact];
vc.excludedActivityTypes = excludeActivities;

if (IsUserInterfaceIdiomPad) {
    vc.popoverPresentationController.sourceView = self.navigationController.view;
}
[self.navigationController presentViewController:vc animated:YES completion:^{

}];

where the items are a NSString and an NSURL

Daniyar
  • 2,975
  • 2
  • 26
  • 39
Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
  • You are aware that the user them self need to write the text? – WizKid Apr 26 '15 at 19:22
  • no, previously the text provided by the item was used... is there a change? – Peter Lapisu Apr 26 '15 at 19:24
  • Is your text appearing for other share types (e.g. Email or Twitter)? Prepopulating Facebook share text is working for me under 8.3 – Paulw11 Apr 26 '15 at 19:49
  • Your problem with items not showing is likely going to be found in the `items` array, yet you do not show how s array is created. Please add all of the code that creates this array to your question. – BergQuester Apr 27 '15 at 05:17
  • 1
    It seems that the latest Facebook App update is responsible - [iOS: How to share text and image on social networks?](http://stackoverflow.com/questions/29890747/ios-how-to-share-text-and-image-on-social-networks) – Paulw11 Apr 27 '15 at 09:27

2 Answers2

9

Looks like Facebook doesn't want the app to pre-propagate the share dialog with text anymore :(

It doesn't have to do anything with the iOS version, but with the build in Facebook App (as the share processes is somehow interlinked with the FB app)

It's stupid and on Android you couldn't do it either (it was disabled longer ago) i hope Facebook reconsiders this as it will lead to fewer shares and some might be willing to drop the share option

Note: if the user doesn't have the FB app installed (he removed it), than the text is added to the status, but i guess that only a small amount of users, but maybe a good reason to still supply text to the share items

Peter Lapisu
  • 19,915
  • 16
  • 123
  • 179
  • 3
    Prefilling content is against Facebook platform policy. Your app should be sharing something meaningful like a link or media. – Ming Li Apr 28 '15 at 18:14
  • it shares a link, but also it shares a short message that summarises the content of the url... we also included hashtags #mediaprovider... in a case when you know what the user will most probably share in his text, its nonsense to let him write it again (this reduces the share rate)... would be much better if you guys over at Facebook, would add a clear text button to the share UI, so a user might easy clear the pre-filled text... twitter has no problem with pre-filling text – Peter Lapisu Apr 29 '15 at 11:54
  • The summary should be provided in the "caption" or "description" fields of the link itself. The API already provides ways to do that. Twitter is a different service with different values and objectives for the user. – Ming Li Apr 29 '15 at 17:02
  • 4
    Facebook should change their policy. The pre-filling text can be editable by user. So user has full power to edit it, delete it or publish it as is, then why facebook remove this feature in iOS I don't understand. Very fool decision by Facebook. – Mahmud Ahsan May 02 '15 at 16:29
0
   NSString *strName= @"Mohit Thatai";
   FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
   [login
    logInWithReadPermissions: @[@"public_profile", @"email"]
    handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
       if (error)
       {
          NSLog(@"Process error");
       }
       else if (result.isCancelled)
       {
          NSLog(@"Cancelled");
       }
       else
       {
         FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];
          [content setContentTitle:@"GPS Tracker"];
          [content setContentDescription:[NSString stringWithFormat:@"%@ shared an interesting link\n       This might be interesting to you: GPS Tracker for Kids",strName]];
 content.contentURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://gpsphonetrackerkids.com"]];
          [FBSDKShareDialog showFromViewController:self
                                       withContent:content
                                          delegate:nil];
       }
    }];
Mohit
  • 359
  • 3
  • 5