-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Twilio - Can I modify the notification data before showing? #1663
Comments
Hi, I will look into it, I not a big fan of this implementation with twi_body, let the developers choose what to to look better to me. What do you observe on iOS? |
in ios, works only in foreground, i am still having issue with background notifications. |
You can test changes on Please refer to the CHANGELOG for update instructions: To install this version:
OR
Make sure your build cache is cleaned. |
I tested and it doesn't show, and in both cases foregruound and background. I call to show the notification manually and it does not show.
|
I'm able to get Twilio message displayed on notification center, when app is background, by following this idea. Here is the patch:
Note that you have to create a channel first in order to get it working properly. In my case, it is
Also putting this in the
this in
|
Hi, Since twilio send data-only, why don't you trigger a local notification with the corresponding field? |
@Dallas62 for android I am using firebase messaging to get the payload and then show to the user as local notification and so far is great. |
@Dallas62 for ios, i am able to show the notifications but the this time is automatically, so it show both always in foreground and background. I am doing a chat app, and when open a channel the notification still show that's the only issue. |
I am doing this, it works but i think I should edit on java to handle the payload, what is the expected payload for android notifications in this library? |
Hi @axeljeremy7 This will be not handled by this library. I don't want to handle each notifications provider. |
@Dallas62 ok 👌, also These are the logs.
In the code, the remote is null when it come from gcm , but the set up in Twilio is based on fcm, so I don't know if the condition in remote notification is ok? |
There is no need to change the Java side. |
@Dallas62 // (required) Called when a remote or local notification is opened or received
onNotification: handler.onNotification.bind(handler), |
Data-only notification are not displayed by the library. |
Uh oh!
There was an error while loading. Please reload this page.
I am using twilio and the payload i received is:
"data": { "channel_title":"0cc332deda83ce6df5a80b4aa18d0e11|2363ce7c6cb4608182", "twi_body":"0cc332deda83ce6df5a80b4aa18d0e11|2363-ce7c6cb4608182;Augustine Sanders: 90", "twi_message_id":"RUbb4b9652c1bb03c5af6deee28de02acd", "channel_sid":"CH05e2a2e60ed0449f94de551fc57a297b", "twi_message_type":"twilio.channel.new_message", "message_sid":"IM1fbbef38a12941e581625babbfac631c", "message_index":"657", "author":"Augustine Sanders", "message_id":"IM1fbbef38a12941e581625babbfac631c", "channel_id":"CH05e2a2e60ed0449f94de551fc57a297b"}
The notification is parse with title as the name of the app and the body as
twi_body
, since this has this value0cc332deda83ce6df5a80b4aa18d0e11|2363-ce7c6cb4608182;Augustine Sanders: 90
, I haven't found a way to modify the payload when i received, I would like just thisAugustine Sanders: 90
, but it looks like this package automatically usetwi_body
ad the value body. I want to know if I can modify before showing.This is so far with tag or version 3.5.2. In this version, remote notifications works in foreground and background.
Log of what i think is getting info
The text was updated successfully, but these errors were encountered: