React Native: I am implementing google maps when it goes to directions/routes it works fine on iPhone but shows error on the Android

0
**WARN     Possible Unhandled Promise Rejection (id: 1):

Error: Could not open URL 'htttps://www.google.com/dir/?api=1&destination=31.45166,74.29813': No Activity found to handle Intent { act=android.intent.action.VIEW dat=htttps://www.google.com/dir/?api=1&destination=31.45166,74.29813 flg=0x10000000 }**

acceptPassengerRequest() {
//Send Driver Location to Passenger
this.socket.emit('driverLocation', {
  latitude: this.state.latitude,
  longitude: this.state.longitude,
});
const passengerLocation = this.state.pointCoords[
  this.state.pointCoords.length - 1
];
if (Platform.OS === 'ios') {
  Linking.openURL(
    `http://maps.apple.com/?daddr=${passengerLocation.latitude},${passengerLocation.longitude}`,
  );
} else {
  Linking.openURL(
    
    `htttps://www.google.com/dir/?api=1&destination=${passengerLocation.latitude},${passengerLocation.longitude}`,

  );
}
android
react-native
android-maps
react-native-maps

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0