分享到React-Native
问题描述:
我想让android设备上的应用程序共享到我的react-native应用程序。但是,我找不到任何可以帮助我的文档,所以我想知道是否有任何方法将其他应用程序的内容共享到我的应用程序?分享到React-Native
我想我的应用程序添加到这个列表
答
你需要允许其他应用开始您的活动。 reference here.
<intent-filter android:label="Share here!">
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/*" />
</intent-filter>
正如你可能会注意到,这巫术会显示您的共享列表中的应用程序。
为了处理负担,请将下一个片段放在组件中。任何组件。
componentDidMount() {
Linking.getInitialURL().then((url) => {
console.log('Initial url is: ' + url);
}).catch(err => console.error('An error occurred', err));
}
这种魅力被称为Linking
。找到文档here
你可以参考这个问题https://stackoverflow.com/questions/11095122/how-to-make-my-android-app-appear-in-the-share-list-of-another-特定的应用程序 –