79460292

Date: 2025-02-22 20:53:39
Score: 1
Natty:
Report link

After struggling with AWS Pinpoint's push notification configuration, I discovered that using keys "Body", "Data", and "Title" in the API request body did not work for me. However, when I passed the notification text in the "RawContent" key, the front-end application successfully received the notification. Here’s an example of how I structured the API request body:

{
   "MessageConfiguration": {
        "GCMMessage": {
            "RawContent": "{\n \"collapse_key\":\"string\",\n\"priority\":\"string\",\n\"time_to_live\":1234,\n\"notification\": {\n\"title\":\"Hello\",\n\"body\":\"Hello from Pinpoint!\",\n \"android_channel_id\":\"string\",\n\"body_loc_args\":[\n\"string\"\n],\n\"body_loc_key\":\"string\",\n\"click_action\":\"string\",\n\"color\": \"string\",\n\"icon\":\"string\",\n\"sound\":\"string\",\n\"tag\":\"string\",\n\"title_loc_args\":[\n\"string\"\n],\n\"title_loc_key\":\"string\"\n},\n\"data\":{\n\"customKey\":\"customValue\"\n}\n}"
        }
    }
}

Using "RawContent" allowed me to directly pass the raw payload in the required format (e.g., JSON for APNS), and it worked perfectly. I hope this helps anyone facing a similar issue!

Reasons:
  • Blacklisted phrase (1): did not work
  • Whitelisted phrase (-1): hope this helps
  • Whitelisted phrase (-1): it worked
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): facing a similar issue
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Amir Ayat