Push notifications not going out from console

I have an Android device registered for push notifications. I can see it on the console, but when i try to send a push notification trough the web console it says “Message scheduled”, but it is never sent. The device never receives the message and neither the message is shown on the message tab of the channel.

Can you specify how you format message body and message headers when you send out a notification from console?

Sure,

info on headers field:
“android-ticker-text”:“Ticker CA”,“android-content-title”:“TItle CA”,“android-content-text”:“Content CA”
message body (Message text field)
Plain text with test message

Also fields publisher id and subtopic are left blank

Thanks. Could you confirm if you configured your backend per the instructions from here?:

http://backendless.com/documentation/messaging/android/messaging_push_notification_setup_androi.htm

Only up to the part where i copy the Google Api Key in BE.
I registered the device trough the REST Api, and the GCMSenderID is not in the required parameters for it.

There are a lot of things happening on the client side in our Android SDK (which you do not use). I assume you’d need to do many of these things in your client-side configuration. See the code here (in particular method “register”, line 149):

and here (method “handleRegistration”, line 241):

Regards,
Mark

I have the exact same problem. I can send push notifications from the Android API through channels and everything works fine. But sending from the console just gives me the Message Scheduled and never arrives at the phone. I did everything specified here: https://backendless.com/documentation/messaging/android/messaging_push_notification_setup_androi.htm.

Hi, Johan!
Are you sending message with necessary headers as described here: https://backendless.com/documentation/messaging/android/messaging_publish_push_notifications.htm ?
These headers must be included while sending if you’re using BacknedlessBroadcastReceiver.

http://support.backendless.com/public/attachments/e5058561abda0c64f850c3ddb1baf40d.png</img>Yes, I have tried a few things along the way. So in the headers section I have placed - “android-content-title”:“content title”, “android-content-text”:“content text” - just to test. I then click on the channel I want to send notifications to (there I can see my device registered). Then click publish?

http://support.backendless.com/public/attachments/5b14d3fb1ce89e17f02911db99b9defb.png</img>

Before clicking “Publish” you should check checkboxes “Push Notification” and “Android devices” - this way message would be sent to all android devices in this channel. Also you can select your device and then check “Push Notification” and “Selected devices” - so the message would be sent to your device only.

I think somewhere I must have left something out. But cannot find it. Also does not work when doing what you suggested.

Looks like you’ve missed “android-ticker-text” header. Add into “headers” with some value.

http://support.backendless.com/public/attachments/79e2bbeb56fe2205ebec1236e866f025.png</img>

Also this coding executes 100% showing that the device is registered. And running this coding instantly gives the noftification:

http://support.backendless.com/public/attachments/69718df4100421008917ed0668a6829a.png</img>

Thanks that worked!

Another thing…how can I see the message that was passed through with the notification? I can clearly see the headers but not the message?

It can be retrieved from intent as string extra, so you can retrieve it like this:

String message = intent.getStringExtra( "message" );

Ok, where do I call that? I suppose you would need to activate a certain activity when the Notification is clicked and then on that activity use getIntent().getStringExtra(“message”)? But how to make your notifications go to a specific activity when clicked? Or is this something I need to work through out of Backendless support?

In order to do it you should implement your own BroadcastReceiver extending BackendlessBroadcastReceiver. Inside you should override “onMessage” method. For example, it can look like the following:

public class MyReceiver extends BackendlessBroadCastReceiver {
@Override
public boolean onMessage( Context context, Intent intent ) {
String message = intent.getStringExtra( "message" );
Toast.makeText( context, "Push received. Message: " + message, Toast.LENGTH_LONG ).show();
return false;
}
}

This code would show toaster with message when receiving notification. Please note that in this case “push” wouldn’t be shown in the notifications bar.
You can find an example of custom BroadcastReceiver in generated “Messaging sample”. Just generate the code from your backendless console and find “PushReceiver” class inside the project.

Thanks, I appreciate your help!