Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Properly handle default values of metadata #926

Merged
merged 1 commit into from
Apr 10, 2020

Conversation

maxkomarychev
Copy link
Contributor

@maxkomarychev maxkomarychev commented Oct 29, 2018

getString returns null if mapping does not exist for a key.
(https://developer.android.com/reference/android/os/BaseBundle.html#getString(java.lang.String))

also createNotificationChannel
(https://developer.android.com/reference/android/app/NotificationManager#createNotificationChannel(android.app.notificationchanne))
fails if channel name is an empty string.

update
A bit more clearer explanation: w/o this fix if channel name is not provided through manifest the getChannelName will return null and the following call to createNotificationChannel (https://github.com/zo0r/react-native-push-notification/blob/master/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java#L577) will fail with exception, which will be swallowed here https://github.com/zo0r/react-native-push-notification/blob/master/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java#L402 and entire flow will silently fail and no notifications will be shown to a user.

mmccartney pushed a commit to mmccartney/react-native-push-notification that referenced this pull request Feb 15, 2019
@Dallas62 Dallas62 self-assigned this Apr 10, 2020
@Dallas62 Dallas62 merged commit d91e6e2 into zo0r:master Apr 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants