fix(ios): fix notification crash when debug=true#633
Open
dr-itz wants to merge 1 commit intomauron85:masterfrom
Open
fix(ios): fix notification crash when debug=true#633dr-itz wants to merge 1 commit intomauron85:masterfrom
dr-itz wants to merge 1 commit intomauron85:masterfrom
Conversation
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
|
related to recent: #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. |
Author
|
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. |
|
If you would like to open a PR for this, I'll merge it into my maintained fork of this project. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the beginning of
onFinishLaunching,center.delegateis set toself. Later on, when debugging is enabled, the current value ofcenter.delegateis saved infoprevNotificationDelegate. Since thishas already been set to
self, a recursion and later a stack overflowhappens.
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