BCG
BCG

Reputation: 11

Twilio Push Notifications: Get received status when sending using Passthrough API

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?

Upvotes: 0

Views: 334

Answers (1)

BCG
BCG

Reputation: 11

It looks like as of now, this feature is not implemented, and is mentioned in their coming soon section along with iOS/Android SDKs

Upvotes: 1

Related Questions