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.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                            | Type                             | Read-Only | Shared |
|---------------------------------|----------------------------------|-----------|--------|
| `Name<mobilesharingpanel.name>` | `String</api/data_types/string>` | ✓         |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                            | Parameters                                                                                                                                                                                                                                                      | Returns                                     | Shared |
|-------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------|--------|
| `Handle<mobilesharingpanel.handle>`             |                                                                                                                                                                                                                                                                 | `Ptr</api/data_types/additional_types/ptr>` |        |
| `ShareFile<mobilesharingpanel.sharefile>`       | file As `FolderItem</api/files/folderitem>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>`      |                                             |        |
|                                                 | files() As `FolderItem</api/files/folderitem>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>`   |                                             |        |
| `SharePicture<mobilesharingpanel.sharepicture>` | picToShare As `Picture</api/graphics/picture>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>`   |                                             |        |
|                                                 | picToShare() As `Picture</api/graphics/picture>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>` |                                             |        |
| `ShareText<mobilesharingpanel.sharetext>`       | textToShare As `String</api/data_types/string>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>`  |                                             |        |
| `ShareURL<mobilesharingpanel.shareurl>`         | urlToShare As `String</api/data_types/string>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>`   |                                             |        |

## Events

<div class="rst-class">

table-centered_column_4

</div>

| Name                                      | Parameters | Returns |
|-------------------------------------------|------------|---------|
| `Cancelled<mobilesharingpanel.cancelled>` |            |         |
| `Closing<mobilesharingpanel.closing>`     |            |         |
| `Completed<mobilesharingpanel.completed>` |            |         |
| `Opening<mobilesharingpanel.opening>`     |            |         |

## Property descriptions

<div id="mobilesharingpanel.name">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileSharingPanel.Name

**Name** As `String</api/data_types/string>`

> The name of the control.

## Method descriptions

<div id="mobilesharingpanel.handle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileSharingPanel.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

> The handle to the underlying native OS control.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>

<div id="mobilesharingpanel.sharefile">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileSharingPanel.ShareFile

**ShareFile**(file As `FolderItem</api/files/folderitem>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>`)

> Displays the sharing panel to the user, allowing them to share the passed *file*.
>
> A `NilObjectException</api/exceptions/nilobjectexception>` is raised if *file* is `Nil</api/language/nil>`.
>
> Share a file:
>
> ``` xojo
> Var file As FolderItem = SpecialFolder.Documents.Child("Test.pdf")
>
> MySharingPanel.ShareFile(file, Self, Me)
> ```

**ShareFile**(files() As `FolderItem</api/files/folderitem>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>`)

> Displays the sharing panel to the user, allowing them to share the passed *files*.
>
> <div class="important">
>
> <div class="title">
>
> Important
>
> </div>
>
> This is supported for iOS only.
>
> </div>
>
> Share files:
>
> ``` xojo
> Var files() As FolderItem = Array(myFile1, myFile2, myFile3)
>
> MySharingPanel.ShareFile(files, Self, Me)
> ```

<div id="mobilesharingpanel.sharepicture">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileSharingPanel.SharePicture

**SharePicture**(picToShare As `Picture</api/graphics/picture>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>`)

> Displays the sharing panel to the user, allowing them to share the passed picture.
>
> A `NilObjectException</api/exceptions/nilobjectexception>` is raised if *picToShare* is `Nil</api/language/nil>`.
>
> Share a picture:
>
> ``` xojo
> MySharingPanel.SharePicture(myPic, Self, Me)
> ```

**SharePicture**(picToShare() As `Picture</api/graphics/picture>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>`)

> Displays the sharing panel to the user, allowing them to share the passed pictures.
>
> Share pictures:
>
> ``` xojo
> Var myPics() As Picture = Array(myPic, myPic2, myPic3)
>
> MySharingPanel.SharePicture(myPics, Self, Me)
> ```

<div id="mobilesharingpanel.sharetext">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileSharingPanel.ShareText

**ShareText**(textToShare As `String</api/data_types/string>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/nil>`)

> Displays the sharing panel to the user, allowing them to share the passed text.
>
> Share text from a Text Area:
>
> ``` xojo
> MySharingPanel.ShareText(DescArea.Text, Self, Me)
> ```

<div id="mobilesharingpanel.shareurl">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileSharingPanel.ShareURL

**ShareURL**(urlToShare As `String</api/data_types/string>`, parentScreen As `MobileScreen</api/user_interface/mobile/mobilescreen>` = `Nil</api/language/nil>`, parentControl As `MobileUIControl</api/user_interface/mobile/mobileuicontrol>` = `Nil</api/language/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:
>
> ``` xojo
> MySharingPanel.ShareURL("http://www.wikipedia.org", Self, Me)
> ```

## Event descriptions

<div id="mobilesharingpanel.cancelled">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileSharingPanel.Cancelled

**Cancelled**

> Called when the sharing panel has been cancelled.

<div id="mobilesharingpanel.closing">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileSharingPanel.Closing

**Closing**

> Called when the control's layout is closing.

<div id="mobilesharingpanel.completed">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

MobileSharingPanel.Completed

**Completed**

> Called when the the sharing panel closes because the user completed sharing something.

<div id="mobilesharingpanel.opening">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

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":
>
> ``` xojo
> 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    |

<div class="seealso">

`MobileControl</api/user_interface/mobile/mobilecontrol>` parent class; `Picture</api/graphics/picture>`

</div>
