Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if a certain app is installed on device with React Native

Tags:

react-native

From my app, I'm trying to check if another app is installed (in my example, Google Maps). So I tried to use:

Linking.canOpenURL('comgooglemaps://?daddr=' + address + '&directionsmode=walking').then(supported => {...}).catch(err => console.error('An error occurred', err));

But it returns that it's not supported so it's like Google Maps is not installed. Do you know a way to solve this issue?

like image 913
Xavier C. Avatar asked Jun 23 '16 10:06

Xavier C.


1 Answers

I'm assuming you're having this problem with iOS.

Starting with iOS 9, you have to declare the URL scheme you want to use. See this other answer with the details.

Or the official doc: https://developers.google.com/maps/documentation/ios-sdk/start#step_7_declare_the_url_schemes_used_by_the_api

like image 54
Jean Regisser Avatar answered Sep 22 '22 19:09

Jean Regisser