Quantcast
Channel: Sarina DuPont, Product Manager RAD Studio
Viewing all articles
Browse latest Browse all 132

Sharing Text via SMS in your iOS apps

$
0
0

Delphi and RAD Studio XE4 provide support for Share Sheet, an iOS 6 feature for sharing text and images via social media, sending them to an AirPrint enabled printer, saving them back to the camera roll etc.

TShowShareSheetAction is the standard action for sharing images and text.

Images and text to be shared can be specified through the Bitmap and the TextMessage properties.

The screenshot below shows a simple implementation of this functionality that allows you to share text that the user has typed into a Memo using SMS.

TShowShareSheetAction will show the available sharing options depending on the type of content you are sharing. This means, that the options shown for Text are different than for a Bitmap.

In this example, I just placed an ActionList component onto my form. I assigned ShowShareSheetAction1 to my SpeedButton on the toolbar and setup an OnBeforeExecute event:

procedure TTextMessageForm.ShowShareSheetAction1BeforeExecute(Sender: TObject);
begin
ShowShareSheetAction1.TextMessage:= Memo1.Lines.Text;
end;

>> For an example on how to share bitmaps, please see this demo in our SourceForge directory.
-Sarina


Viewing all articles
Browse latest Browse all 132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>