Skip to content

Adds support for drawable resources to AndroidNotification #1221

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

Merged
merged 1 commit into from
Jun 17, 2018

Conversation

aMarCruz
Copy link
Contributor

@aMarCruz aMarCruz commented Jun 16, 2018

@chrisbianca ,

Currently, RNF does not support drawable resources for images passed to the setBigPicture and setLargeIcon 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):

image

This icon in this card is set by Image source={ uri: ic_medical } (drawable resource):

image

This commit adds support for "drawable" to the setBigPicture and setLargeIcon 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

@chrisbianca chrisbianca merged commit fbc72dc into invertase:master Jun 17, 2018
@chrisbianca
Copy link
Contributor

Good spot, thank you!

@Salakar
Copy link
Contributor

Salakar commented Jul 10, 2018

@aMarCruz thanks for this, this is now live in the v4.3.0 release.


Loving react-native-firebase and the support we provide? Please consider supporting us with any of the below:

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.

3 participants