我试过npm模块 react-native-check-app-install 但我一直没能做到,结果总是假的。
react-native-check-app-install
也尝试了 react-native-installed-apps 获取手机中安装的应用程序列表,但此返回始终为空列表。
react-native-installed-apps
你确定要声明URL方案吗?
https://developers.google.com/maps/documentation/ios-sdk/start#step_6_declare_the_url_schemes_used_by_the_api
一旦你这样做了,你就不需要额外的软件包来检查你是否可以打开谷歌地图。您可以只使用链接模块。
Linking.canOpenURL('comgooglemaps://?center=40.765819,-73.975866') .then((canOpen) => { if (canOpen) { console.log('open google maps'); } else { console.log('open apple maps'); } });