Closed denebchorny closed 7 years ago
At the moment this feature is not supported. I can add this feature soon. (After and before client interaction)
Thanks.
v2.0.0 fixed
I got a error : undefined is not a object (evaluating '_reactNativeAndroidLocationServicesDialogBox2.defauly.checkLocationServicesEnabled') Help please
Getting the same error as @Sidibedev . My code looks like `import LocationServicesDialogBox from "react-native-android-location-services-dialog-box";
LocationServicesDialogBox.checkLocationServicesIsEnabled({ message: "Use Location ?", ok: "YES", cancel: "NO" }).then(function(success) { console.log(success); // success => "enabled" }).catch((error) => { console.log(error.message); // error.message => "disabled" });`
Is there something like that this isn't working with not ejected apps?
TypeError: undefined is not an object (evaluating '_reactNativeAndroidLocationServicesDialogBox2.default.checkLocationServicesIsEnabled') . I have the same error too
RN and android version ?
yes, react native 0.55.3 and running on Android device 6.0
"dependencies": {
"expo": "^27.0.1",
"react": "^16.3.1",
"react-addons-update": "^15.6.2",
"react-native": "0.55.3",
"react-native-android-location-services-dialog-box": "^2.4.4",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-permissions": "^1.1.1",
"react-navigation": "^1.5.11",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-thunk": "^2.2.0"
}
"expo": {
"sdkVersion": "27.0.0"
},
had there been any fix for this yet ?
TypeError: undefined is not an object (evaluating '_reactNativeAndroidLocationServicesDialogBox2.default.checkLocationServicesIsEnabled') . I have the same error too
I've used this package before in react native 0.46 with version 2.2.1 and work fine but now with react natve 0.51 and this package version 2.5 i get this error
-- restart your PC or MAC (for background process) -- uninstall your app on mobile device
folow the steps below at the terminal step by step :
1) react-native unlink react-native-android-location-services-dialog-box
2) npm uninstall react-native-android-location-services-dialog-box
3) npm install react-native-android-location-services-dialog-box --save
4) react-native link react-native-android-location-services-dialog-box
5) react-native run-android
@webyonet : Very nice package! Any plan to implement for iOS?
Hi @isaaclem this feature is native for ios
I Fix it, I change compileOnly to Compile and it work properly
I want to know how to check if the gps was enabled by the user after the displayed dialog or before.
I mean, using you method there could be 2 stages:
1) If the GPS is enabled (before showing the dialog) calling your method will return success 2) If the GPS is disabled (before showing the dialog) calling your method will return succes if and only if the user enable the GPS in the prompted interface
Why I need this? I have a button. If it is pressed and the GPS is disabled I show a dialog, and if the user enable the GPS in the prompted interface I dont want to continue the process instead the user has to click the button again.
In the case the GPS is enabled then there is no any dialog to show.
I don't know if you understand what I'm trying to say.
PD: I don't know if this article could be useful. In my case I don't know how to do what it says https://stackoverflow.com/questions/41795968/react-native-check-and-promp-user-to-enable-network-gps/42002015#42002015
How can I achieve this?