Q:

React Native - open native share

Hi i am using react native's webview to display some HTML. Whenever a user clicks on that share button inside that HTML, I want it to open the share native
Is that possible?

EDIT 1

# your app react-native

import {Share, WebView} from 'react-native'

nativeShare = async (data) => {
        const shareOptions = {
        message: data.message
        }
        if ('object' == typeof data && data.external_url_open) {
            return Linking.openURL(data.external_url_open);
        } else {
            try {
            await Share.share(shareOptions)
            }catch (error) {
            alert(error.message);
            }
        }
    }
<WebView
    source={{ uri: "https://google.com" }}
    javaScriptEnabled={true}
    onMessage={event => { this.nativeShare(JSON.parse(event.nativeEvent.data)) }}
    />

# in your aplication did u post

var message = 'hello';
window.postMessage(message);

A:

You can post a message from your HTML to your component and show native share window whenever the message received.
Check this prop of RN's WebView out
https://facebook.github.io/react-native/docs/webview#onmessage

