Im trying to create my custom notification, but having some problems, and it seems to be related with the usage of BackendlessPushService class (Android).
Im extending BackendlessPushService and overriding onMessage():
@Override
public boolean onMessage(Context context, Intent intent) {
String message = intent.getStringExtra(“message”);
String title = intent.getStringExtra(“android-content-title”);
Timber.e("Message: " + message);
Timber.e("Title: " + title);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setSmallIcon(android.R.drawable.ic_menu_report_image)
.setContentTitle(title)
.setContentText(message)
.setAutoCancel(true);
NotificationManager mNotificationManager =
(NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
mNotificationManager.notify(234567, mBuilder.build());
return false;
}
Here I receive the values Title and Message from server (so the class is also properly registered in Manifest) and I return false, as the documentation says: "Returning false, cancels the execution of the default implementation"For testing purpose i created a button that creates a notification, which uses the same code as onMessage() and the notification is properly created, but for some reason the notification is not created when coming from server. Am I missing anything?