Please login to access all of the features of the Community Site.

ShareContent

M v1.0

Using the ShareContent command you can open up the standard OS share dialog that lets the user share a piece of text or a URL to other apps and services.

If the CommandParameter is a plain string then it will simply share the text string. Alternatively, you can specify a ShareContentParameters object and supply additional options as seen below.

Properties

PropertyTypeDescription
TitlestringThe title of the share window.
TextstringA text string to be shared.
UristringA URL string to be shared.
ShareAsFile
M v2.0
booleanIndicates that the Uri should be downloaded to the device and then shared as a file so other applications on the device can be used to open the file.
<Button Text="Tap"
    Command="{Binding ShareContent}"
    CommandParameter="Rock ChMS has an app!" />
<Button Text="Tap"
    Command="{Binding ShareContent}">
    <Button.CommandParameter>
        <Rock:ShareContentParameters Title="Endorse Rock!"
            Text="Rock ChMS has an app!"
            Uri="https://www.rockrms.com/" />
    </Button.CommandParameter>
</Button>
<Button Text="Tap"
    Command="{Binding ShareContent}">
    <Button.CommandParameter>
        <Rock:ShareContentParameters Title="Check out this movie!"
            Uri="https://upload.wikimedia.org/wikipedia/commons/c/c5/Big_buck_bunny_poster_big.jpg"
            ShareAsFile="true" />
    </Button.CommandParameter>
</Button>

Property UX

M v6.0

The sharing experience will change depending on the Title, Text, and Uri provided. Providing only a Title will not work ‒ a Text or Uri value is required. Let's review the options using the sample command here:

<Rock:ShareContentParameters Title="What is Rock"
    Text="Learn more about Rock RMS!"
    Uri="https://www.rockrms.com" />

These screenshots show the OS share prompt and content received within the Messages app.

Title + Text

Title + Uri

Text + Uri

Uri

Title + Text + Uri

When sharing content via a URI, it is common for the content to include an image. The image is derived from the metadata of the webpage the URI links to. When using Rock RMS, editing this metadata can be done from within the advanced settings of the desired page.

Click here for deeper insight on metadata properties.

<meta property="og:url" content="https://rockrms.com/">
<meta property="og:title" content="Rock Mobile">
<meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/c/c5/Big_buck_bunny_poster_big.jpg">

Without this metadata present, no image will be displayed when sharing content.