Support Topics Documentation Slack YouTube Blog

Authentication Error (messaging)

I am getting Authentication Error when I try to send push or message to devices from the console. What should I do?

solved

What did you do to solve it

Hi, Joel.

Do you have some problems with messaging?
Please, provide more information about it.

Regards,
Kate.

Well Im trying to test the service. I provided the Google android API key, turned on GCM in google console, typed a message, put in header and subtopic, pressed publish and “Authentication Error” came up

When I do see message sent, I dont see anything on my device

Please, make sure you configure all like was described here:
http://backendless.com/documentation/messaging/android/messaging_push_notification_setup_androi.htm

ok, so I did all that. Im not getting the error anymore but Im not seeing the notification on my device

and I am connected to the internet and my device is registered

Please, send your app id to this email kateryna.maksimenko@gmail.com

As in the application ID from Backendless?

[reply user_id=76][h4]Катя Максименко wrote:[/h4]Please, send your app id to this email kateryna.maksimenko@gmail.com[/reply]I sent it

In order to receive push notifications on your Android device you should declare some push receiver class in your application, which will be responsible for handling and displaying the message, received from server.
You can generate the sample chat code at Backendless console and see the example inside - class PushReceiver, which extends BackendlessBroadcastReceiver. Also don’t forget to declare the receiver in your AndroidManifest.xml - you can also see the example in the generated sample.

[reply user_id=157][h4]Sergey Chupov wrote:[/h4]In order to receive push notifications on your Android device you should declare some push receiver class in your application, which will be responsible for handling and displaying the message, received from server.
You can generate the sample chat code at Backendless console and see the example inside - class PushReceiver, which extends BackendlessBroadcastReceiver. Also don’t forget to declare the receiver in your AndroidManifest.xml - you can also see the example in the generated sample.[/reply]Ok, I saw that but it looks complex. Should I just use the PushReceiver class? I will try anyway

Is there a link to a tutorial for this also?

Hi, Joel

You can find tutorial for handling push notifications here:

http://developer.android.com/google/gcm/client.html

Regards,
Kate.

[reply user_id=76][h4]Катя Максименко wrote:[/h4]Hi, Joel

You can find tutorial for handling push notifications here:

http://developer.android.com/google/gcm/client.html

Regards,
Kate.[/reply]Thanks but I read that already. I am talking about something that mentions the Push Receiver as Sergey said. I don’t see any thing with that.

Hi, Joel,

The problem is that Google changes the mechanism of handling push notifications rather frequently with new Android SDK versions, so we are hardly able to describe it properly. Besides that, Backendless’ role in case of push notifications is to deliver your message to GCM servers. After that, GCM sends the push notification to your device and this is completely your app’s responsibility to handle it in the way Google’s guidelines tell. So the link above contains most of the information you need to customize handling the push notification and the way it is displayed on device in order to fit your app’s requirements.

Nevertheless, I think in most cases you can use the PushReceiver class provided in code generation, in case you don’t want to learn any details about push notifications on Android devices. But remember, that in order to control the flow completely and avoid unexpected errors, you will have to read some Google’s tutorials.

And as for the link, the part that mentions the Push Receiver is here: http://developer.android.com/google/gcm/client.html#sample-receive , specifically the note describes the way it is implemented in our code generation.

Note: Using [url=http://developer.android.com/reference/android/support/v4/content/WakefulBroadcastReceiver.html]WakefulBroadcastReceiver[/url] is not a requirement. If you have a relatively simple app that doesn't require a service, you can intercept the GCM message in a regular [url=http://developer.android.com/reference/android/content/BroadcastReceiver.html]BroadcastReceiver[/url] and do your processing there. Once you get the intent that GCM passes into your broadcast receiver's onReceive()method, what you do with it is up to you.

[reply user_id=157][h4]Sergey Chupov wrote:[/h4]Hi, Joel,

The problem is that Google changes the mechanism of handling push notifications rather frequently with new Android SDK versions, so we are hardly able to describe it properly. Besides that, Backendless’ role in case of push notifications is to deliver your message to GCM servers. After that, GCM sends the push notification to your device and this is completely your app’s responsibility to handle it in the way Google’s guidelines tell. So the link above contains most of the information you need to customize handling the push notification and the way it is displayed on device in order to fit your app’s requirements.

Nevertheless, I think in most cases you can use the PushReceiver class provided in code generation, in case you don’t want to learn any details about push notifications on Android devices. But remember, that in order to control the flow completely and avoid unexpected errors, you will have to read some Google’s tutorials.

And as for the link, the part that mentions the Push Receiver is here: http://developer.android.com/google/gcm/client.html#sample-receive , specifically the note describes the way it is implemented in our code generation.

Note: Using [url=http://developer.android.com/reference/android/support/v4/content/WakefulBroadcastReceiver.html]WakefulBroadcastReceiver[/url] is not a requirement. If you have a relatively simple app that doesn't require a service, you can intercept the GCM message in a regular [url=http://developer.android.com/reference/android/content/BroadcastReceiver.html]BroadcastReceiver[/url] and do your processing there. Once you get the intent that GCM passes into your broadcast receiver's onReceive()method, what you do with it is up to you.

[/reply]Ok. Thank you Sergey. Will try.