Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dr-itz
Copy link

@dr-itz dr-itz commented Sep 30, 2019

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

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 mauron85#565
@jackie-d
Copy link

related to recent: #657

@stale
Copy link

stale bot commented Sep 14, 2020

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 stale bot added the stale auto labeled abandoned issues after a period of inactivity label Sep 14, 2020
@dr-itz
Copy link
Author

dr-itz commented Sep 14, 2020

This is still required...

@stale stale bot removed the stale auto labeled abandoned issues after a period of inactivity label Sep 14, 2020
@ChrisKuper
Copy link

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!

@RaddishIoW
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Start up and run IOS crash
4 participants