mixpanel / mixpanel-swift

Official iOS (Swift) Tracking Library for Mixpanel Analytics
https://mixpanel.com
Apache License 2.0
434 stars 234 forks source link

Rich Notifications(image) -iOS Swift #368

Closed SheriefD closed 4 years ago

SheriefD commented 4 years ago

According to the documentation , image url is added like so : {"aps": { "alert": { "title": "Testing", "body": "This is a test!" }, "sound": "default", "mutable-content": 1, "data": { "attachment-url": "url_to_your_image" }}}

according to code it should be inside the mp_media_url : { "mp":1, "mp_media_url":"https://pluspng.com/img-png/link-zelda-png-file-link-ssb-3ds-wii-u-png-443.png", "aps": { "alert": { "title": "Testing", "body": "This is a test!" }, "sound": "default", "mutable-content": 1, }}

Sending from he mixpanel portal is never showing the image for iOS , also using the new (sandbox/production)SSL is not working for sandbox when added to mixpanel .

jbwyme commented 4 years ago
  1. Thanks for the report. I let our team know! For reference, here's an example of a correct payload:
{
    "aps": {
        "sound": "default",
        "mutable-content": 1,
        "alert": {
            "body": "test",
            "title": "Test"
        }
    },
    "mp": {
        "c": 10000000,
        "distinct_id": "demo_user",
        "m": 10000000,
        "token": "21124e7aabd9811600e7534ef10db795"
    },
    "mp_buttons": [
        {
            "lbl": "Mixpanel",
            "id": "Mixpanel",
            "ontap": {
                "type": "browser",
                "uri": "https://mixpanel.com"
            }
        }
    ],
    "mp_media_url": "https://images.mxpnl.com/2098992/a2481c78c0b449b62bd0f90cf9dae5a0.jpg"
}
  1. Unfortunately we don't support the combo sandbox/production cert on our backend right now
jbwyme commented 4 years ago

Sending from he mixpanel portal is never showing the image for iOS

Can you share the image url you're using?

SheriefD commented 4 years ago

"https://pluspng.com/img-png/link-zelda-png-file-link-ssb-3ds-wii-u-png-443.png"

Sending from he mixpanel portal is never showing the image for iOS

Can you share the image url you're using?

"https://pluspng.com/img-png/link-zelda-png-file-link-ssb-3ds-wii-u-png-443.png"

SheriefD commented 4 years ago

Will this issue be resolved soon? . I haven't heard back from anyone for two weeks now !

jbwyme commented 4 years ago

Just to confirm, did you setup the NotificationServiceExtension? https://github.com/mixpanel/mixpanel-swift#3-extend-your-notificationservice-from-mixpanelnotificationserviceextension

If you add action buttons using the push notification builder UI, do those buttons show up when you send a preview?

image

SheriefD commented 4 years ago

@jbwyme ok, Did you fix anything from your side ? We just tested the images again and it worked fine, though we didn't make any update to the implementation we did 14days ago when we raised this issue ? can you please confirm?

jbwyme commented 4 years ago

Nothing specific to image loading. However, I know that iOS only allows for a certain amount of time for an image to be loaded before it shows the push notification without it. So there are some variables we can't control for like client and image server connection speed.

jbwyme commented 4 years ago

Let me know if things are working well and I'll close this issue!

SheriefD commented 4 years ago

Thank you