本文介绍了如何制作“给这个应用评分"React Native 应用程序中的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在 iOS 上的 React Native 应用程序中将用户正确链接到 App Store 应用程序的评论页面?

How to properly link a user to reviews page at App Store app in React Native application on iOS?

推荐答案

对于 iOS,你必须将 LSApplicationQueriesSchemes 作为数组参数添加到 Info.plist 并添加项目到它.

For iOS you Have to add LSApplicationQueriesSchemes as Array param to Info.plist and add items to it.

例如到 AppStore 链接,我使用 itms-apps 作为此数组中的参数之一.

For example to AppStore linking I use itms-apps as one of params in this array.

例如:

<key>LSApplicationQueriesSchemes</key>
<array>
  <string>itms-apps</string>
</array>

你的链接应该是这样的

itms-apps://itunes.apple.com/us/app/id${APP_STORE_LINK_ID}?mt=8.

嗯.现在你有所有的东西可以用方法来做链接组件

Well. Now you have all stuff to do Link component with method

handleClick () {
    Linking.canOpenURL(link).then(supported => {
        supported && Linking.openURL(link);
    }, (err) => console.log(err));
}

这篇关于如何制作“给这个应用评分"React Native 应用程序中的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 23:14