Closed verybluebot closed 5 years ago
ok after more digging in the native code on the client I tried to send smallIcon
and largeIcon
instead of icon
and it worked.. this should really be in the docs a lot of time wasted here..
Hey @verybluebot ! Thanks for pointing this out. We would appreciate a PR adding the documentation, if you have the time :smile: it sounds like a great addition!
@hypesystem this does not work on when on notification
key.. only on body
and only when message
key is added (otherwise it will be a silent notification that would not go to notification center on client thus trigger nothing...
the first part of this mite be the handling of the React Native library im using on client but im not sure have not dug deep enough on this...
@verybluebot I think we've heard about that issue before, where that particular library expects a slightly odd format. However, the documentation of smallIcon
and largeIcon
would still be welcome :smile:
ok so ill add it with a warring note :/ wait for it...
Hi @verybluebot,
That is indeed not directly caused by node-gcm
, as it is a very specific implementation decision made by the react-native push notification library you are using, to supply icons in the notification payload. The FCM documentation does not endorse this, it is a format that only your RN plugin expects, and they have documented it on their GitHub page. 👍
@eladnava yes you are definitely right problem is they don't have documentation for that either, I figure it out by digging the plugins native classes.. maybe it should be mentioned in this library this uses case because Im assuming there are more RN users like me that will need to implement it in this way
@verybluebot I believe it should only be mentioned in the RN library which has this quirky implementation, we can't go and keep track of and document every unofficial client library's quirky implementation details. node-gcm
is a server-side library used for interfacing with the FCM APIs. Using 3rd-party unofficial client plugins is up to you.
Instead, create a PR in the RN library and document this quirky implementation there. 👍
@eladnava "quirky" is the exact word... and its the "main"/go to library for handling push notifications on RN.. yes.. this does not belongs here.. I got tired on these type of issues working with RN to be honest. I think Ill go more towards native development in future projects.
From my understanding of the docs (and testing)
when you specify
icon
it acctuallysmallIcon
on android how can I set thelargeIcon
and if this even exists?
PS: im working with React Native on the client but ok with setting a hard coded small and large icons in the native code
I test this in my
AndroidManifest.xml
:but this sets the small icon (if its in the right size and not colored) I want to hard code the largeIcon or pass it in some way using this library is this possible?
thanks