Hi,
I’m implementing push notifications on my app and I’m facing problems for Android 6.0.
I have tried both sending notification from device and from Backendless Console but the result is the same: for devices with Android >= 6.0 seems not working, while with lower versions it works fine.
I put all the header correctly and I followed the tutorial.
Yes,
the only difference is that I have to sent push notifications to just one user at time.
And to do this I used:
DeliveryOptions deliveryOptions = new DeliveryOptions();
deliveryOptions.addPushSinglecast(id);
deliveryOptions.setPushPolicy(PushPolicyEnum.ONLY);
PublishOptions publishOptions = new PublishOptions();
publishOptions.putHeader( “android-ticker-text”, “You just got a private push notification!” );
publishOptions.putHeader( “android-content-title”, “This is a notification title” );
publishOptions.putHeader( “android-content-text”, “Push Notifications are cool” );
Backendless.Messaging.publish(channel, message, publishOptions, deliveryOptions, new AsyncCallback<MessageStatus>() { @Override
public void handleResponse(MessageStatus response) {
}
@Override
public void handleFault(BackendlessFault fault) {
}
I also tried to customize the onMessage method (returning false) using the notificationBuilder and I got push notifications working but only when app is foreground and still not working in background.