I need to check if an android device has Google Play Services installed to avoid calling expo-location getCurrentPositionAsync (available only with google play service).
I have found how do to it in Kotlin but not a lib in react-native.
There is this one package : But it is dead for 5 years now and 0 weekly download.
Is there an alternative way to know this using RN or expo ?
Thanks for reading me.
I need to check if an android device has Google Play Services installed to avoid calling expo-location getCurrentPositionAsync (available only with google play service).
I have found how do to it in Kotlin but not a lib in react-native.
There is this one package : https://www.npmjs.com/package/react-native-play-services But it is dead for 5 years now and 0 weekly download.
Is there an alternative way to know this using RN or expo ?
Thanks for reading me.
Share Improve this question asked yesterday BaartBaart 5821 gold badge6 silver badges19 bronze badges1 Answer
Reset to default 0I ended up using this package : react-native-device-info
With the function
import DeviceInfo from 'react-native-device-info';
async function checkGooglePlayServices() {
const isPlayServicesAvailable = await DeviceInfo.hasGms(); // Returns true if Google Play Services are available
return isPlayServicesAvailable;
}
It does detect correctly with emulated non google android phone.
https://github.com/react-native-device-info/react-native-device-info?tab=readme-ov-file#hasGms