Unable to send Custom Data to iOS using Corona SDK / Python

Answered

Comments

2 comments

  • Avatar
    Sergey Polshcha

    You should put "custom" key to "aps" dictionary, like this:

     {
    "request": {
        "auth": "your api key",
        "application": "your app id",
        "notifications": [
            {
                "send_date": "now",
                "ios_root_params": {
                    "aps": {
                        "alert":"1111",
                        "custom" : {"asd" : "asd"}
                    }
                }
            }
        ]
    }
    }
    

    I just create sample project with your code and it's working:

    May 21 16:07:37 Fectums-iPad Sample[1420] <warning>: onNotification() {"type":"remote","name":"notification","custom":{"asd":"asd"},"sound":"default","alert":"1111","applicationState":"active"} null

    May 21 16:07:37 Fectums-iPad Sample[1420] <warning>: Custom data is table: 0x1467dd70 {"asd":"asd"}

  • Avatar
    osconfused

    This works! Thanks! Might be worth noting that this also works without having to next inside aps. This is also working for me: "ios_root_params":{ "custom": { "aboolean":False, "astring":"apstop", "anarray":[1,2,3,4,5], "aninteger":55, "afloat":550.556, "adict":{"foo":"bar"}, }, },

Please sign in to leave a comment.