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: crash when application launched from UNUserNotificationCenter notification #25702
Merged
Conversation
This file contains 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
codebytere
approved these changes
Sep 30, 2020
miniak
force-pushed
the
miniak/fix-notification-crash
branch
from
September 30, 2020 16:46
c6fe695
to
0f5d3d6
Compare
MarshallOfSound
approved these changes
Sep 30, 2020
nornagon
reviewed
Oct 1, 2020
nornagon
approved these changes
Oct 1, 2020
miniak
force-pushed
the
miniak/fix-notification-crash
branch
from
October 1, 2020 19:41
0f5d3d6
to
8304453
Compare
alexeykuzmin
approved these changes
Oct 2, 2020
Release Notes Persisted
|
This was referenced Oct 2, 2020
I have automatically backported this PR to "10-x-y", please check out #25737 |
I have automatically backported this PR to "11-x-y", please check out #25738 |
I have automatically backported this PR to "9-x-y", please check out #25739 |
6 tasks
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.
Description of Change
We have a custom node module, which is using the new
UNUserNotificationCenter
APIs to show notifications. When the application is launched from such notification, theNSApplicationLaunchUserNotificationKey
points to aUNNotificationResponse
instance instead ofNSNotification
. This leads to an unrecognized selector exception. Check forNSNotification
before accessing theuserInfo
property.We can also use the
NSApplicationLaunchUserNotificationKey
directly, as it was introduced in macOS 10.8Checking
userInfo
fornil
is not necessary, as it's done byNSDictionaryToDictionaryValue
.Checklist
npm test
passesRelease Notes
Notes: Fixed crash when application launched from
UNUserNotificationCenter
notification (via a native node module).