Adds support for drawable resources to AndroidNotification #1221
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.
@chrisbianca ,
Currently, RNF does not support drawable resources for images passed to the
setBigPicture
andsetLargeIcon
methods of AndroidNotification. On the other hand, RN does not support mipmap resources as Image.source uri, which means duplicating these resources in both folders.The icon in this notification is set through
.android.setLargeIcon('ai_medical')
(mipmap resource):This icon in this card is set by
Image source={ uri: ic_medical }
(drawable resource):This commit adds support for "drawable" to the
setBigPicture
andsetLargeIcon
methods.Not sure if RN determine the correct folder/size of the result, but at least
BitmapFactory.decodeResource (getResources(), drawableId)
can decode drawables (I don't know how you make a test for this).Environment
Platform: Android
Development Operating System: Linux Mint 18.3
Build Tools: Android Studio 3.2, Android SDK 27
React Native version: 0.55.4
RNFirebase Version: 4.2
Firebase Module: notifications