Files
react-native/docs/autogen_Share.md
T
2017-08-31 11:29:32 -07:00

10 lines
2.4 KiB
Markdown

---
id: share
title: Share
category: APIs
permalink: docs/share.html
---
<div><div></div><span><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="docs/share.html#methods">#</a></h3><div class="props"><div class="prop"><h4 class="methodTitle"><a class="anchor" name="share"></a><span class="methodType">static </span>share<span class="methodType">(content, options)</span> <a class="hash-link" href="docs/share.html#share">#</a></h4><div><p>Open a dialog to share text content.</p><p>In iOS, Returns a Promise which will be invoked an object containing <code>action</code>, <code>activityType</code>.
If the user dismissed the dialog, the Promise will still be resolved with action being <code>Share.dismissedAction</code>
and all the other keys being undefined.</p><p>In Android, Returns a Promise which always be resolved with action being <code>Share.sharedAction</code>.</p><h3><a class="anchor" name="content"></a>Content <a class="hash-link" href="docs/share.html#content">#</a></h3><ul><li><code>message</code> - a message to share</li><li><code>title</code> - title of the message</li></ul><h4><a class="anchor" name="ios"></a>iOS <a class="hash-link" href="docs/share.html#ios">#</a></h4><ul><li><code>url</code> - an URL to share</li></ul><p>At least one of URL and message is required.</p><h3><a class="anchor" name="options"></a>Options <a class="hash-link" href="docs/share.html#options">#</a></h3><h4><a class="anchor" name="ios"></a>iOS <a class="hash-link" href="docs/share.html#ios">#</a></h4><ul><li><code>excludedActivityTypes</code></li><li><code>tintColor</code></li></ul><h4><a class="anchor" name="android"></a>Android <a class="hash-link" href="docs/share.html#android">#</a></h4><ul><li><code>dialogTitle</code></li></ul></div></div><div class="prop"><h4 class="methodTitle"><a class="anchor" name="sharedaction"></a><span class="methodType">static </span>sharedAction<span class="methodType">()</span> <a class="hash-link" href="docs/share.html#sharedaction">#</a></h4><div><p>The content was successfully shared.</p></div></div><div class="prop"><h4 class="methodTitle"><a class="anchor" name="dismissedaction"></a><span class="methodType">static </span>dismissedAction<span class="methodType">()</span> <a class="hash-link" href="docs/share.html#dismissedaction">#</a></h4><div><p>The dialog has been dismissed.
@platform ios</p></div></div></div></span></div>