How To start application after click push notification kotlin android studio
i want start my app after click push notification
Simply add PendingIntent
on notification builder like below:
create activityIntent
and add Activity name that you want to open(here isMainActivity
)
Intent activityIntent = new Intent(this, MainActivity.class);
Now create pending intent:
PendingIntent pendingIntent =
PendingIntent.getActivity(
this, // calling from Activity
0,
appActivityIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
Now add this pendingIntent
to your notification builder
builder.setContentIntent(pendingIntent);
Note : I have only written the pending intent code because it's only missing in your code. I assume you have all the required code like notification builder