Skip to content

APNS Payload getting to device is in different format which sent to client #37

@DeepthiJonnagaddla

Description

@DeepthiJonnagaddla

Hi,

We are facing issue with payload message what server sending is not retrieving at device. Could someone please let me know where we are missing in the below payload structure.

This is the server side code sending to client :

if tuser.apns_token:
                    token = tuser.apns_token
                    message = {
                        "title": from_tuser.name,
                        "body": message,//"Fdfdsf"
                        "jid": message_from,
                        "content-available": 1,
                        "xml": xml,
                        "sound": "default",
                    }
                    logger.info('Payload: %s' % message)
                    result = client.send_message(token, message)

But receiving this payload in device :

{
"body": Fdfdsf, 
"google.c.fid": xxxxxxxx,
 "google.c.sender.id": xxxxxxxxx,
 "gcm.message_id": xxxxxxxx,
 "aps": {
    "content-available" = 1;
},
 "Nick": DeepthiJonna
}

Expecting Payload is :

{
"body": {
"title": from_tuser.name,
"body": "Fdfdsf",
"jid": message_from,
"content-available": 1,
"xml": xml
"sound": "default",
},
"google.c.fid": xxxxxxxx,
"google.c.sender.id": xxxxxxxxx,
"gcm.message_id": xxxxxxxx,
"aps": {
"content-available" = 1;
},
"Nick": DeepthiJonna
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions