cordova-plugin-background-geolocation
cordova-plugin-background-geolocation copied to clipboard
fix(ios): fix notification crash when debug=true
At the beginning of onFinishLaunching
, center.delegate
is set to
self
. Later on, when debugging is enabled, the current value of
center.delegate
is saved info prevNotificationDelegate
. Since this
has already been set to self
, a recursion and later a stack overflow
happens.
The commit that added the code 80be0fd ("iOS avoid taking control of UNUserNotificationCenter", 2018-08-20) has not removed the block at the beginning, but the original one referenced there did: https://github.com/mauron85/react-native-background-geolocation/pull/268/files
So that was probably a mis-merge.
Fixes #565
related to recent: https://github.com/mauron85/cordova-plugin-background-geolocation/issues/657
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is still required...
Tested the proposed fix on iPhone 6 with iOS 12.4.9. It definitely solves the recursion bug which still exists in the current release of the plugin and really needs fixing. Not sure why this pull request is not used. Thx to @dr-itz for this life-saver!
If you would like to open a PR for this, I'll merge it into my maintained fork of this project. https://github.com/HaylLtd/cordova-plugin-background-geolocation