customerio / customerio-flutter

Flutter plugin for Customer.io
https://www.customer.io/docs/sdk/flutter/getting-started/
MIT License
12 stars 10 forks source link

Not able to send image as custom payload #100

Closed Imgkl closed 9 months ago

Imgkl commented 10 months ago

This is our custom payload, that we use in push notifications.

{
  "message": {
    "notification": {
      "body": "Test Body Content",
      "title": "Test Title",
      "image": "https://userimg-assets.customeriomail.com/images/client-env-131039/1700504487599_Screenshot%202023-11-20%20at%2011.50.36%E2%80%AFPM_01HFPZEJBRSHCTC2XB1T6SGJXE.png"
    },
    "android": {
      "priority": "high"
    },
    "data": {
      "redirect": "route",
      "triggerString": "String",
    }
  }
}

This never works on both Android and iOS. We seem to have the set done.

Imgkl commented 10 months ago

FYI. With the rich push editor, we are able to do it.

mrehan27 commented 10 months ago

Hi @Imgkl, Thanks for reaching out. The sample JSON you shared may only work for Android, as iOS expects a different JSON structure. I just tried this on Android with our sample app and was able to see the image in the notification (screenshot below). Can you please make sure you are using the newer version of the SDK?

For iOS, the payload should match what's described in the docs, or you can use the JSON tab in the Rich Push Editor to determine the final JSON that the SDK is expecting.

Imgkl commented 10 months ago

Hi @mrehan27,

Thanks for your reply. I am on the latest version. I tried the push notification based on the json you refered above.

{
  "message": {
    "apns": {
      "payload": {
        "aps": {
          "mutable-content": 1,
          "alert": {
            "title": "string", 
            "body": "string" 
           }
        },
        "CIO": {
          "push": {
            "image": "https://userimg-assets.customeriomail.com/images/client-env-131039/1700504487599_Screenshot%202023-11-20%20at%2011.50.36%E2%80%AFPM_01HFPZEJBRSHCTC2XB1T6SGJXE.png" 
          }
        }
      }
    } 
  }
}

I still receive the notification without image. I could see it on the preview panel though.

mrehan27 commented 10 months ago

Thank you for sharing the details. Unfortunately, we haven't been able to reproduce the issue, as the JSON seems to be working fine on our end. Could you please try the following steps?

If the issue persists, please share your logs and relevant files like AppDelegate and NotificationServiceExtension with us at win@customer.io, including a link to this ticket and the campaign you are testing.

levibostian commented 9 months ago

Closing issue due to inactivity.

Feel free to add new comments and we would be happy to re-open and help.