检查 google 地图应用程序是否安装在 react-native iOS 中

check if google maps app is installed in react-native iOS

我尝试使用 npm 模块 react-native-check-app-install 但我总是无法实现,结果是错误的。

还尝试使用 react-native-installed-apps 获取安装在 phone 中的应用程序列表,但此 return 始终为空列表。

您确定要申报 URL 计划吗?

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'); }
});