cordova-plugin-googlemaps: Back button event conflict with registerBackButtonAction()
I’m submitting a … (check one with “x”) [ ] question [x] any problem or bug report [ ] feature request
plugin version: (check one with “x”) [ ] 1.4.x [x] 2.0.0-beta3
cordova information: (run $> cordova plugin list)
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-googlemaps 2.0.0-beta3-20170811-1937 "cordova-plugin-googlemaps"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
Current behavior:
If you add the googlemaps plugin, registerBackButtonAction() will not be respected; application will exit regardless.’
Expected behavior: App should continue to respect registerBackButtonAction(), and allow control of hardware back button.
Steps to reproduce:
- Load project from https://github.com/ryanhalley/hardwarebackbutton
- Run ‘cordova run android -cl’ and press hardware Back button on Android device; exit dialog should appear.
- Run: ionic cordova plugin add https://github.com/mapsplugin/cordova-plugin-googlemaps#multiple_maps --variable API_KEY_FOR_ANDROID=“YOUR_ANDROID_API_KEY_IS_HERE” --variable API_KEY_FOR_IOS=“YOUR_IOS_API_KEY_IS_HERE”
- Run ‘cordova run android -cl’, press Back button; app will close.
If your problem is solved, please consider small amount donation to this project. Appreciate for your kindness. https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/README.md#buy-me-a-beer
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 1
- Comments: 44 (16 by maintainers)
Commits related to this issue
- Add: trigger the plugin_touch event when you tap on marker (in order to detect the dialog something) Update: Allow the backbutton event to another code (#1639) — committed to mapsplugin/cordova-plugin-googlemaps by wf9a5m75 7 years ago
- Bug fix: map.clear() does not work correctly (#1639, #1669) — committed to mapsplugin/cordova-plugin-googlemaps by wf9a5m75 7 years ago
@CesarAPPinheiro I don’t know which version do you use, but it’s easy. When you enter(?) to the map page, execute
cordova.fireDocumentEvent('plugin_touch', {});https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/whats-new-v2/README.md#change-4-save-battery-life
@ryanhalley I figured out the solution, and the plugin does not block the backbutton event anymore. Please try the new version.