更新时间:2023-10-24 10:58:10
对于 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));
}