now I'm testing http request using POSTMAN
**"to": "/topics/all", ---> ?? how can i write this line??**
"priority": "high",
"notification": {
"title": "テスト Title",
"body": "テスト Body"
},
"data": {
"click_action": "FLUTTER_NOTIFICATION_CLICK"
}
I checked status 200 ok
when I send message with firebase web page, it works well
but without firebase cloud message service, it doesn't work
In firebase cloud message service, the targeting condition is
I'm suppose that if i can write targeting condition in http format, I can send message to my app
help me
What you are looking for is key "topic"
{
"topic": "all",
"notification":{
"title": "テスト Title",
"body": "テスト Body"
},
"data":{
"click_action": "FLUTTER_NOTIFICATION_CLICK"
}
}
Related
I'm currently trying to send a notification using the " Try this API " interface of Firebase.
I filled my Request Body with this :
{
"validateOnly": false,
"message": {
"notification": {
"body": "Body",
"title": "Title"
}
}
}
and the RequestParameters with
projects/myprojectid
I didn't check the Google API Key since my project doesn't have one, but I checked the Google OAuth 2.0.
After executing, I get this error :
{
"error": {
"code": 400,
"message": "Recipient of the message is not set.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "message",
"description": "Recipient of the message is not set."
}
]
},
{
"#type": "type.googleapis.com/google.firebase.fcm.v1.FcmError",
"errorCode": "INVALID_ARGUMENT"
}
]
}
}
After some research, I don't understand what is missing in the request. Are all the parameters mandatory for the request ?
You're not specifying who the message is for, which is what the error message is trying to tell you. You can do by either including a token key with one of more device tokens, or a topic or condition key in the JSON.
Also see the Firebase documentation on building requests to send a message for more information and examples of each of these.
When I'm sending the push notification, I want to set the priority to it.
I have check the reference link:
https://developer.huawei.com/consumer/en/doc/development/HMS-3-References/push-server-send#BadgeNotification
But I couldn't find exactly where to set priority.
I'm using this JSON format:
{
"validate_only": false,
"message": {
"notification": {
"title": "Big News",
"body": "This is a Big News!"
},
"android": {
"notification": {
"title": "Noti in Noti title",
"body": "Noti in Noti body",
"click_action": {
"type": 1,
"intent": "#Intent;compo=com.rvr/.Activity;S.W=U;end"
}
}
},
"token": ["AAWWHI94sgUR2RU5_P1ZptUiwLq7W8XWJO2LxaAPuXw4_HOJFXnBlN-q5_3bwlxVW_SHeDPx_s5bWW-9DjtWZsvcm9CwXe1FHJg0u-D2pcQPcb3sTxDTJeiwEb9WBPl_9w"]
}
}
Please help me by providing some reference.
The posted reference link is for the old HMS version 3 document. Please refer to the latest document.
Under section AndroidConfig Structure, there is an Urgency parameter for setting the message delivery priority:
Under the AndroidNotification Structure section, there is an Importance parameter to set the message notification priority.
I am able to send Push Notification using Postman. I don't want to use a separate server and send Push Notifications using PHP.
Current using POST method - https://fcm.googleapis.com/fcm/send
As I am using Firestore as database and Firebase as hosting to host my app
How can I send notifications using Firebase server. Below is what I am using via Postman to send a notification at the moment.
{
"to": "my token id",
"data": {
"title": "Push Message",
"message": "This is notification will change tab",
"sound": "default",
"badge": 2,
"page": "offline-storage",
"taskid":156
},
"notification":{
"title": "Push Message",
"message": "This is notification will change tab",
"sound": "default",
"badge": 2,
"page": "offline-storage",
"taskid":156
}
}
Screenshot attached
I'm using the Twilio Notify Service to send push notifications to APN and FCM. We would like to switch to the passthrough API for situations where we send to a large number of users at once. Howerver, I'm not getting the to_binding field in the response, so have no idea how many succeeded or failed. When sending using identity, we get an array of identities.
Here is what we are sending:
twilio_client.notify.v1.services(ENV.fetch('TWILIO_NOTIFY_SERVICE')).notifications.create(
to_binding: params[:users],
body: params[:body],
title: params[:title],
data: {data: #data},
fcm: {
data: {
title: params[:title],
body: params[:body]
}
}
)
I get notifications on the devices, but this is what I get back:
{"body": "stuff", "sound": null, "sms": null, "alexa": null, "facebook_messenger": null, "tags": [], "title": "My Title", "segments": [], "ttl": 545435, "gcm": null, "account_sid": "account_id", "priority": "high", "apn": null, "data": {"data": {"a_thing": 995, "type": "My Type", "id": 4344}}, "sid": "myid", "action": null, "date_created": "2019-11-05T15:25:27Z", "service_sid": "service_id", "identities": [], "fcm": {"data": {"body": "stuff", "title": "My Title"}}}
in the example from the docs (https://www.twilio.com/docs/notify/api/notification-resource?code-sample=code-send-a-notification-to-bindings-in-the-request-1&code-language=Ruby&code-sdk-version=5.x), it looks like a toBindings field should come back.
Is there a way to get this working, or some way to fetch received receipt data after with the notification id?
It looks like as of now, this feature is not implemented, and is mentioned in their coming soon section along with iOS/Android SDKs
I am trying to send to multiple messages within one Webhook call to Dialogflow, which shall be passed to Messenger. Right now my Webhook responds with a malfunctioning JSON body:
{
'fulfillmentText': "Text",
'fulfillmentMessages': [{
"platform": "facebook",
"text": [{
"text": "Text"
}]
}],
'source': "facebook"
}
When I test the Webhook via Messenger I see the is typing symbol, but never receive the Text message. While testing the same Webhook from the Dialogflow Console I get
Webhook execution successful
returned. I guess I am missing some JSON fields to tell Dialogflow in which format it has to send the JSON two the Messenger API. Anybody having any clues on how to solve this issue?
Edit:
My latest not working trial...
{
"fulfillmentText": "Hola!",
"fulfillmentMessages": [
{
"text": {
"text": [
"Title: this is a title"
]
},
"platform": "FACEBOOK"
},
{
"text": {
"text": [
"Title: this is a title"
]
},
"platform": "FACEBOOK"
}
]
}
If you're only sending text you only need to provide a string to the fulfillmentText and don't have to provide the fulfillmentMessages attribute.
If you do provide a fulfillmentMessages attribute with the target platform Dialogflow will send your payload to Facebook. In this case, where the payload is invalid, no message will actually be surfaced in Facebook. remove the fulfillmentMessages attribute of the response JSON and your bot should respond.
If you'd like to add a card to your response you can send the following response:
{
"fulfillmentMessages": [
{
"platform": "FACEBOOK",
"card": {
"title": "Title: this is a title",
"subtitle": "This is an subtitle. Text can include unicode characters including emoji 📱.",
"imageUri": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
"buttons": [
{
"text": "This is a button",
"postback": "https://assistant.google.com/"
}
]
}
}
]
}
EDIT: If you want to send multiple messages you can do so by sending a response like this (this JSON will send two identical cards but you can change the message type (card/text/etc) based on this documentation):
{
"fulfillmentMessages": [
{
"platform": "FACEBOOK",
"card": {
"title": "Title: this is a title",
"subtitle": "This is an subtitle. Text can include unicode characters including emoji 📱.",
"imageUri": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
"buttons": [
{
"text": "This is a button",
"postback": "https://assistant.google.com/"
}
]
}
},
{
"platform": "FACEBOOK",
"card": {
"title": "Title: this is a title",
"subtitle": "This is an subtitle. Text can include unicode characters including emoji 📱.",
"imageUri": "https://developers.google.com/actions/images/badges/XPM_BADGING_GoogleAssistant_VER.png",
"buttons": [
{
"text": "This is a button",
"postback": "https://assistant.google.com/"
}
]
}
}
]
}
I mailed the Dialogflow support about this issue and it turns out that it is currently not possible to send multiple messages from a webhook.
Hi,
At this point, it's not possible to send sequential messages directly
from webhook. However, if you are using one of our one-click
integrations that support rich messages, you can invoke intents in
which multiple messages are defined from webhook through an event as
described at
https://dialogflow.com/docs/events#invoking_event_from_webhook.
Let me know if you have any questions.
Regards, Ankita from Dialogflow