2

I'm using Delphi 10.1.2 Berlin for developing android and iOs mobile application. And I have faced issue for Facebook text sharing option.

And how can I able to implement Facebook text sharing option using SDK? And I don't find any clear help files for sharing text in FB using Delphi. Please help me and Thanks in advance.

Community
  • 1
  • 1
test12345
  • 367
  • 1
  • 21
  • There is no way. You are not allowed to prefill text – WizKid Mar 10 '17 at 03:17
  • But they have mentioned the [Facebook sharing option](https://developers.facebook.com/docs/sharing/android) using Java. But the example is not provided for Delphi – test12345 Mar 10 '17 at 03:30
  • Where in that document do they mention text sharing? – WizKid Mar 10 '17 at 03:32
  • **a contentDescription of the content, usually 2-4 sentences** is the place where we can provide the text – test12345 Mar 10 '17 at 04:30
  • Sure. https://developers.facebook.com/docs/graph-api/reference/v2.8/user/feed#publish explains how you specify description of the link – WizKid Mar 10 '17 at 04:57
  • But How can I implement this in Delphi.? – test12345 Mar 15 '17 at 02:24
  • I have no idea how you do an HTTP request in Delphi but I assume the are guides that tell you how to do that. And then you read the Facebook documentation on what you need to send to Facebook – WizKid Mar 15 '17 at 02:33

1 Answers1

3

Here is multiplatform version:

uses   
  FMX.Platform, FMX.MediaLibrary;  

procedure ShareTextWith(const aText: string);
var
  vSharingService: IFMXShareSheetActionsService;
begin
  TPlatformServices.Current.SupportsPlatformService(IFMXShareSheetActionsService, vSharingService);
  vSharingService.Share(nil, aText, nil);

end;

Also you can use ShowShareSheetAction for both platform.

alitrun
  • 1,127
  • 8
  • 14