From 4c24cfdb4f6351732941a23b26e08a4e59e19c08 Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Fri, 2 Nov 2018 17:50:22 +0000 Subject: [PATCH] Deploy website Deploy website version based on c58a9088faaad3251d0299827edbb090283e75ac --- docs/next/share.html | 37 ++++++++++++++++++++++++++++++++++++- docs/next/share/index.html | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 72 insertions(+), 2 deletions(-) diff --git a/docs/next/share.html b/docs/next/share.html index 87e287e0265..50701881e96 100644 --- a/docs/next/share.html +++ b/docs/next/share.html @@ -78,7 +78,42 @@

dismissedAction()

static dismissedAction()
 
-

The dialog has been dismissed. @platform ios

+

iOS Only. The dialog has been dismissed.

+

Basic Example

+
import React, {Component} from 'react'
+import {Share, Button} from 'react-native'
+
+class ShareExample extends Component {
+
+  async onShare = () => {
+    try {
+      const result = await Share.share({
+        message:
+          'React Native | A framework for building native apps using React',
+      })
+
+      if (result.action === Share.sharedAction) {
+        if (result.activityType) {
+          // shared with activity type of result.activityType
+        } else {
+          // shared
+        }
+      } else if (result.action === Share.dismissedAction) {
+        // dismissed
+      }
+    } catch (error) {
+      alert(error.message);
+    }
+  };
+
+  render() {
+    return (
+      <Button onPress={this.onShare}>Share</Button>
+    );
+  }
+
+}
+
← Shadow PropsStatusBarIOS →