aws-amplify / amplify-flutter

A declarative library with an easy-to-use interface for building Flutter applications on AWS.
https://docs.amplify.aws
Apache License 2.0
1.31k stars 241 forks source link

Blank notification after upgrading the flutter to v3.22.2 #5144

Closed MSRSK closed 6 days ago

MSRSK commented 1 month ago

Description

When building the app using flutter v3.19.0, notifications are working fine,

image

But, when building the app using flutter v3.22.2, I'm getting blank notification like show in the below screenshot

image

Categories

Steps to Reproduce

  1. Use Flutter v3.22.2
  2. Build any app which use amplify push notifications.
  3. Send notifications using below template format from pinpoint
    {
    "APNSMessage": {
    "aps": {
      "alert": ""
    }
    },
    "GCMMessage": {
    "priority": "high",
    "notification": {
      "title": "Notification Test Title",
      "body": "Notification Test body",
      "image": "https://miro.medium.com/v2/resize:fit:600/1*fVC87uhTotJSYoiSo2LU1g.png"
    },
    "data": {
      "message": ""
    }
    },
    "ADMMessage": {
    "data": {
      "message": ""
    }
    },
    "BaiduMessage": {
    "title": "",
    "description": ""
    }
    }

Screenshots

image

Platforms

Flutter Version

3.22.2

Amplify Flutter Version

2.2.0

Deployment Method

AWS CDK

Schema

No response

Equartey commented 1 month ago

Hi @MSRSK, thank you for reporting this. We'll need to investigate to find the root cause and will provide an update when we can.

To confirm, this was only observed on Android? Have you tested iOS?

MSRSK commented 1 month ago

Hi @MSRSK, thank you for reporting this. We'll need to investigate to find the root cause and will provide an update when we can.

To confirm, this was only observed on Android? Have you tested iOS?

Only observed in android

Equartey commented 1 month ago

@MSRSK thanks for confirming. We will update you when you have more info!

tyllark commented 1 month ago

Hello @MSRSK I was able to reproduce the blank push notification on both Flutter 3.22.2 and 3.19.0 with the raw message json you provided. I updated the raw json to the following and confirmed that the title, body, and image were displaying on Flutter 3.22.2. Can you please try this out and let us know if it resolves your problem.

{
    "APNSMessage": {
        "aps": {
            "alert": ""
        }
    },
    "GCMMessage": {
        "priority": "high",
        "data":{
            "pinpoint.notification.imageUrl": "https://miro.medium.com/v2/resize:fit:600/1*fVC87uhTotJSYoiSo2LU1g.png",
            "pinpoint.openApp": "true",
            "pinpoint.notification.title": "Notification Test Title2",
            "pinpoint.notification.body": "Notification Test body",
            "pinpoint.notification.silentPush": "0"
       }
    },
    "ADMMessage": {
        "data" : {
            "message": ""
        }
    },
    "BaiduMessage": {
        "title":"",
        "description": ""
    }
}
MSRSK commented 1 month ago

This works but not the imageurl, but my previous versions of the app works normally but this version Still have the issue

Jordan-Nelson commented 4 weeks ago

@MSRSK can you share some more details about the device you are using? Did you reproduce this on a physical device? What type of device and OS? Have you tested any other Android devices?

MSRSK commented 4 weeks ago

@MSRSK can you share some more details about the device you are using? Did you reproduce this on a physical device? What type of device and OS? Have you tested any other Android devices?

This is happening on all the devices, I have released an update of my app, people after updating were facing this issue(in Android)

MSRSK commented 4 weeks ago

But if you need specifics, I was checking in Android 13

Jordan-Nelson commented 4 weeks ago

@MSRSK - Were there any other changes other than upgrading from flutter 3.19 to 3.22.2? If you switch back to 3.19 without any code changes is this still working as expected?

MSRSK commented 4 weeks ago

Yes, after switching back to 3.19 it started working. I didn't make any other changes

Jordan-Nelson commented 4 weeks ago

Thanks for the info @MSRSK. We were not able to reproduce that behavior. As @tyllark noted above, he was initially able to reproduce the issue with the provided json. However it was reproducible on both v3.19 and 3.22.2. After updating the json as noted in https://github.com/aws-amplify/amplify-flutter/issues/5144#issuecomment-2240054479, the notification showed on both v3.19 and 3.22.2.

It sounds like after you updated to json format in https://github.com/aws-amplify/amplify-flutter/issues/5144#issuecomment-2240054479, the title/message are showing, but the image is not showing. Is that correct? Can you provide a screenshot so that we can compare it to what we are seeing?

MSRSK commented 3 weeks ago

Give me some time to record a video.

MSRSK commented 3 weeks ago

Thanks for the info @MSRSK. We were not able to reproduce that behavior. As @tyllark noted above, he was initially able to reproduce the issue with the provided json. However it was reproducible on both v3.19 and 3.22.2. After updating the json as noted in https://github.com/aws-amplify/amplify-flutter/issues/5144#issuecomment-2240054479, the notification showed on both v3.19 and 3.22.2.

It sounds like after you updated to json format in https://github.com/aws-amplify/amplify-flutter/issues/5144#issuecomment-2240054479, the title/message are showing, but the image is not showing. Is that correct? Can you provide a screenshot so that we can compare it to what we are seeing?

What have you updated in the json?

Jordan-Nelson commented 3 weeks ago

@MSRSK I believe @tyllark had initially reproduced the issue with the JSON you provided in your original issue description. After updating the JSON to the value in this comment (https://github.com/aws-amplify/amplify-flutter/issues/5144#issuecomment-2240054479), the issue could not longer be reproduced.

Jordan-Nelson commented 2 weeks ago

@MSRSK please let us know if you are still facing this issue. Thanks.

Jordan-Nelson commented 6 days ago

@MSRSK I am going to close this out since we were unable to reproduce this have not heard back.