webyonet / react-native-android-location-services-dialog-box

React Native Android Location Services Dialog Box
MIT License
182 stars 50 forks source link

Crash when press the hardware back #32

Closed CliveTeow closed 6 years ago

CliveTeow commented 7 years ago

The app will crash scenarios:

  1. Click the no button and click hardware back
  2. Click hardware back to close the dialog, and click hardware back again.
CliveTeow commented 7 years ago

Seems the promise.reject(new Throwable("disabled")); is called twice. (1st time: cancel or first hardware back press, 2nd time: 2nd hardware back press.

webyonet commented 7 years ago

RN and android version ?

CliveTeow commented 7 years ago

react-native: 0.48.0 Android version: 4.4 (real device)

I only able to test this on real devices. My another real device is XiaoMi Redmi Note 2, which will prompt its own request GPS dialog.

Sathiyamm commented 6 years ago

@CliveTeow remove this code and its working correctly in my app. BackHandler.addEventListener('hardwareBackPress', () => { LocationServicesDialogBox.forceCloseDialog(); });