Hi, i was receiving push notification by using backendless default receiver, but i have to open a specific activity when user click on notification, so i created my own receiver, but now it didn’t receive notification here is my code and manifest file,
when i override onMessage method, it shows " overrides deprecated method in 'com.backendless.push.BackendlessBroadcastReceiver"
i think it didn’t goes in onMessage method.
public class PushReceiver extends BackendlessBroadcastReceiver{
private static final int NOTIFICATION_ID = 1;
@Override
public boolean onMessage(Context context, Intent intent) {
Toast.makeText(context, “Received in extended class”, Toast.LENGTH_SHORT).show();
String message = intent.getStringExtra(“message”);
NotificationCompat.Builder builder =
new NotificationCompat.Builder(context)
.setContentTitle(“Hello”).setContentText(message).setSmallIcon(R.mipmap.ic_launcher);
Intent notificationIntent = new Intent(context, singleMessage.class);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
builder.setContentIntent(contentIntent);
return true;
}
}
and manifest file
<intent-filter>
<category android:name=“com.example.mubtadanaqvi.highayhelp”/>
</intent-filter>
</receiver>
<service android:name=“com.backendless.push.BackendlessPushService”/>
and the activiy which i want to open
<intent-filter>
<category android:name=“android.intent.category.DEFAULT”/>
</intent-filter>