我尝试使用 npm 模块react-native-check-app-install
但我无法实现,结果总是错误的。
还尝试过react-native-installed-apps
获取手机中安装的应用程序列表,但这始终返回空列表。
您确定声明了 URL 方案吗?
https://developers.google.com/maps/documentation/ios-sdk/start#step_6_declare_the_url_schemes_used_by_the_api https://developers.google.com/maps/documentation/ios-sdk/start#step_6_declare_the_url_schemes_used_by_the_api
完成此操作后,您不需要额外的软件包来检查是否可以打开 Google 地图。您只需使用链接模块即可。
Linking.canOpenURL('comgooglemaps://?center=40.765819,-73.975866')
.then((canOpen) => {
if (canOpen) { console.log('open google maps'); } else { console.log('open apple maps'); }
});
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)