Search code examples
quickblox

Quickblox, send push notification via REST API


When trying to send a push notification:

{'event[environment]': 'development', 'event[notification_type]': 'push', 'event[message]': u'payload=VGhpcyBpcyBhIHB1c2ggbm90aWZpY2F0aW9uIEFQSSBUZXN0', 'event[user][ids]': 'xxx', 'token': xxx'}

I get following result from the API.

{"code":null,"message":"invalid byte sequence in UTF-8"}

The Payload is a base64 encoded string, so it should work properly. Anyone an idea what's wrong here?

thanks, phil


Solution

  • It looks like your message is not in the correct format:

    Did you encode a JSON Object like the following one as Base64 ?

    "aps": { "alert": "Some text", "badge": 1, "sound": "default" }