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:

  1. Load project from https://github.com/ryanhalley/hardwarebackbutton
  2. Run ‘cordova run android -cl’ and press hardware Back button on Android device; exit dialog should appear.
  3. 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”
  4. 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

Most upvoted comments

@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.