Class
MobileSharingPanel
Description
A Sharing Panel allows the application to share a piece of text, a URL, a file, or a picture with any registered system service or app.
Methods
Name |
Parameters |
Returns |
Shared |
---|---|---|---|
file As FolderItem, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil |
|||
files() As FolderItem, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil |
|||
picToShare As Picture, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil |
|||
picToShare() As Picture, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil |
|||
textToShare As String, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil |
|||
urlToShare As String, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil |
Method descriptions
MobileSharingPanel.Handle
Handle As Ptr
The handle to the underlying native OS control.
Important
This is supported for iOS only.
MobileSharingPanel.ShareFile
ShareFile(file As FolderItem, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil)
Displays the sharing panel to the user, allowing them to share the passed file.
A NilObjectException is raised if file is Nil.
Share a file:
Var file As FolderItem = SpecialFolder.Documents.Child("Test.pdf") MySharingPanel.ShareFile(file, Self, Me)
ShareFile(files() As FolderItem, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil)
Displays the sharing panel to the user, allowing them to share the passed files.
Important
This is supported for iOS only.
Share files:
Var files() As FolderItem = Array(myFile1, myFile2, myFile3) MySharingPanel.ShareFile(files, Self, Me)
MobileSharingPanel.SharePicture
SharePicture(picToShare As Picture, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil)
Displays the sharing panel to the user, allowing them to share the passed picture.
A NilObjectException is raised if picToShare is Nil.
Share a picture:
MySharingPanel.SharePicture(myPic, Self, Me)
SharePicture(picToShare() As Picture, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil)
Displays the sharing panel to the user, allowing them to share the passed pictures.
Share pictures:
Var myPics() As Picture = Array(myPic, myPic2, myPic3) MySharingPanel.SharePicture(myPics, Self, Me)
MobileSharingPanel.ShareText
ShareText(textToShare As String, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil)
Displays the sharing panel to the user, allowing them to share the passed text.
Share text from a Text Area:
MySharingPanel.ShareText(DescArea.Text, Self, Me)
MobileSharingPanel.ShareURL
ShareURL(urlToShare As String, parentScreen As MobileScreen = Nil, parentControl As MobileUIControl = Nil)
Displays the sharing panel to the user, allowing them to share the passed URL (urlToShare).
An InvalidArgumentException is raised if the urlToShare parameter is not a valid URL construct.
Share a URL:
MySharingPanel.ShareURL("http://www.wikipedia.org", Self, Me)
Event descriptions
MobileSharingPanel.Cancelled
Cancelled
Called when the sharing panel has been cancelled.
MobileSharingPanel.Closing
Closing
Called when the control's layout is closing.
MobileSharingPanel.Completed
Completed
Called when the the sharing panel closes because the user completed sharing something.
MobileSharingPanel.Opening
Opening
Called when the control's layout is opening.
This is where you typically put initialization code.
This example in the Opening event of a label sets its text to "Hello":
Me.Text = "Hello"
Notes
By default, Xojo provides a default message that will appear when the user is asked for permission to access their photo library. If you wish to customize this message, go to Build Settings in the Navigator, click on iOS then click on the Advanced tab in the Inspector. Enable Photo Access then click the Options button.
Compatibility
Project Types |
Mobile |
Operating Systems |
All |
See also
MobileControl parent class; Picture