OneSignal / OneSignal-Flutter-SDK

OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your flutter app with OneSignal
https://www.onesignal.com
Other
616 stars 213 forks source link

[Bug]: All included players are not subscribed #896

Closed realchrisparker closed 4 months ago

realchrisparker commented 4 months ago

What happened?

Using the REST API I consistently receive the response "All included players are not subscribed". This issue is new as a few months ago this worked correctly. I provide a external Id that is attached to a subscription. Regardless if I enclude a segment or not, error persists.

Steps to reproduce?

I post the following payload to https://onesignal.com/api/v1/notifications

{
  "app_id": [MY APP ID],
  "target_channel": "push",
  "headings": {
    "en": "Procedure pre-authorization updated."
  },
  "subtitle": {
    "en": "78900 - Abdmnal pain unspcf site"
  },
  "contents": {
    "en": "New status is Pended"
  },
  "IncludedSegments": [
    "All Subscriptions"
  ],
  "include_aliases": {
    "ExternalIds": [
      "e04a3473-862c-4f1e-a161-951bb5434809"
    ]
  },
  "data": {
    "type": "ServiceReview",
    "id": "12345678",
    "fhirId": ""
  },
  "big_picture": "https://demostorage.pqt.health/users/e04a3473-862c-4f1e-a161-951bb5434809/images/greg_transparent.png",
  "ios_attachments": "{\"id1\": \"https://demostorage.pqt.health/users/e04a3473-862c-4f1e-a161-951bb5434809/images/greg_transparent.png\", }",
  "isIos": true,
  "isAndroid": true
}

What did you expect to happen?

Notification to send, response body reflects this.

OneSignal Flutter SDK version

11.2

Which platform(s) are affected?

Relevant log output

{"id":"","errors":["All included players are not subscribed"]}

Code of Conduct

realchrisparker commented 4 months ago

Similar to last reported issue https://github.com/OneSignal/OneSignal-Flutter-SDK/issues/887, I have check the dashboard and member is subscribed and external id is correct.

realchrisparker commented 4 months ago

Sorry, I figured it out shortly after I submitted the bug. I initially didn't include the segments. As you can see above, when I did include it, I had the JSON property name wrong. Changing it to "included_segments" allowed the notification to be sent.