I am using backendless push notification in my app following the way as described in backendless. I have implemented an receiver that extends bacendless service. Now I see that, the notification comes on notification bar and shows only the portion of message that is available in one line. Even clicking on that notification, takes me to the main activity and happens nothing. I have used handler to shoe message in activity but not showing. Now all that I want, receiving the notification from backendless, showing that in a custom way and also in an activity after clicking the notification in notification bar.
Asked
Active
Viewed 307 times
1 Answers
0
I built a simple app such that in the main activity you can click a button to send notification (to the same device just for learning purposes), then after sending the notification, I start another activity to read the contents of the notification message.. and it worked but I have no idea how to link it with the notification bar so that the message appears after clicking the notification in the notification bar.
this may not answer all of your questions but it may help because you posted that you couldn't read the message..
below is the code I used to receive the content of a message.. and I published the notifications in a specific channel (my channel)
AsyncCallback<List<Message>> subscriptionResponder = new AsyncCallback<List<Message>>()
{
@Override
public void handleResponse( List<Message> messages )
{
Iterator<Message> messageIterator = messages.iterator();
while( messageIterator.hasNext() )
{
Message message = messageIterator.next();
Map<String, String> headers = message.getHeaders();
String str= headers.get( "android-content-text" );
// get the other headers
Log.i ("My app", "Received message - " + str) ;
}
}
@Override
public void handleFault( BackendlessFault backendlessFault )
{
//handle Fault
}
};
AsyncCallback<Subscription> methodCallback = new AsyncCallback<Subscription>() {
@Override
public void handleResponse(Subscription response) {
Log.i ("My app", "handleResponse of methodCallback ") ;
}
@Override
public void handleFault(BackendlessFault fault) {
//handle Fault
}
};
SubscriptionOptions subscriptionOptions = new SubscriptionOptions();
Backendless.Messaging.subscribe( "my channel", subscriptionResponder, subscriptionOptions , methodCallback );

Maria
- 45
- 6
-
Sorry it's not the case i am looking for. – Razon Jun 08 '16 at 12:26