Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

react-native - 如何使用Share()在react-native中共享应用程序的URL链接?(How to share URL link of app in react-native using Share()?)

I like to share the app link through social media so that when the receiver click the shared link it will open the App installed with the information shared(deep linking).

(我喜欢通过社交媒体共享应用程序链接,这样当接收者单击共享链接时,它将打开安装了共享信息(深度链接)的应用程序。)

Please find the code here :

(请在这里找到代码:)

onShare = (articleShare) => {

(onShare =(articleShare)=> {)

    debugger;
    console.log('THis is article');
    try {
        const result = Share.share({
                title: articleShare.articleTitle,
                message: articleShare.articleContent,
                url:'AppName://ArticleDetail/'+articleShare._id,
            },
            {dialogTitle: 'Share Article',});
        if (result.action === Share.sharedAction) {
            Meteor.call('ShareArticleNotification', articleShare);
        }
        ;
    } catch (error) {
        alert(error.message);
    }
    ;
};
  ask by Omkar translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...