【发布时间】:2016-03-13 06:10:23
【问题描述】:
我在 iOS 上使用 RN 0.20。我想创建一个链接,如果您单击该链接,它会将您重定向到手机中可用的地图应用程序及其坐标。这就是我使用 Linking 组件所做的。
redirectToMap() {
Linking.canOpenURL('geo:37.484847,-122.148386').then(supported => {
if (supported) {
Linking.openURL('geo:37.484847,-122.148386');
} else {
console.log('Don\'t know how to go');
}
}).catch(err => console.error('An error occurred', err));
}
但它一直让我“不知道该怎么走”。但是,我从https://facebook.github.io/react-native/docs/linking.html 中的文档中看到,使用geo: 链接到地图是可行的。
【问题讨论】:
标签: ios reactjs react-native