Receiving a custom message in a notification and in accordance with KeyWork True or false or your specific word go to action Public class MyFirebaseMessagingService extends FirebaseMessagingService {
private static final String TAG = "FirebaseMessageService"; Bitmap bitmap; @Override public void onMessageReceived(RemoteMessage remoteMessage) {
// If a notification is listened, any data accompanying the notification // message is available for additional purposes. In this project, a launcher // intentional dismissal when listening to a notification, so any accompanying data will // be processed here. If you want a different intention to fire, set the click_action // field of the notification message with the desired intention. Launcher Institution // Used when click_action is not specified. // // We process the possible data accompanying the notification. if (getIntent (). getExtras ()! = null) {
for (String key : getIntent().getExtras().keySet()) { String value = getIntent().getExtras().getString(key); if (key.equals("AnotherActivity") && value.equals("True")) { Intent intent = new Intent(this, AnotherActivity.class); intent.putExtra("value", value); startActivity(intent); finish(); } } }
This is data
{ "data": { "image": "https://ibin.co/2t1lLdpfS06F.png", "message": "Firebase Push Message Using API" "AnotherActivity": "True" }, "to" : "f25gYF3***********************HLI" }
source share