Search code examples
push-notificationquickbloxmessage

Push notification in quickblox have broken


No I started use push notification in my project (it worked sometime ago), but can't make it work. I downloade sample-messages project and changed my account and application settings. But messaged don't delivered to receiver. Registration of device is ok. I see my subscribtion. No errors from response when sending notification. What I only got is the json description from logs, when i click my message from queue (but it's in status "sent") Can't get it work. Please, help.

{"notification":{"registration_ids":["APA91bEsqEY2OcaQpgU6Nmk6P7P0fSEdnGuXHSOnUwMJ3ZCAuZC0hGiE_7DX-TlvuAnivJ3Bt4nSM7eEN3AR2Qg2jjCGC8RRT7GbDJgpuy25plCohb23CpD5hLaHo7l-TZvgZhpXjCM0"],"delay_while_idle":false,"data":{"message":"fgjkkkkllkleddxccvvvcxfffffjhghvfg I was ","collapse_key":"event5711312"},"time_to_live":86400},"log":[{"device_token":null,"created_at":"2016-02-23T18:21:42Z","delivered_at":null,"failed_at":"2016-02-23T18:21:47Z","error_code":401,"error_description":"Unable to deliver notification 11778569, received error 401 (Unauthorized, check your App auth_key.)"}]}

Solution

  • I redid all the configuration steps in the link:http://quickblox.com/developers/SimpleSample-messages_users-android#Setup_GCM

    Now it is back to work!

    Attention to some details:

    1. The API key you have to use in Google cloud console is of the SERVER type
    2. Use the same package name on Android manifest and Google cloud console
    3. Use your application ID from developer console to get GCM token on your Android application
    4. don't forget to copy the google-services.json (generated when you enabled Google services for your app) to app/ directory on your project (the same directory of your src/)