cordova-plugin-background-geolocation icon indicating copy to clipboard operation
cordova-plugin-background-geolocation copied to clipboard

fix(ios): fix notification crash when debug=true

Open dr-itz opened this issue 5 years ago • 5 comments

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

dr-itz avatar Sep 30 '19 11:09 dr-itz

related to recent: https://github.com/mauron85/cordova-plugin-background-geolocation/issues/657

jackie-d avatar Mar 18 '20 11:03 jackie-d

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.

stale[bot] avatar Sep 14 '20 12:09 stale[bot]

This is still required...

dr-itz avatar Sep 14 '20 15:09 dr-itz

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!

ChrisKuper avatar Jan 08 '21 18:01 ChrisKuper

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

RaddishIoW avatar Mar 23 '21 11:03 RaddishIoW