سلام روزتون بخیر ببخشید چطور می تونیم وقتی نوتیفیکیشن به کاربر ارسال شد وقتی کاربر روی نوتیفیکیشن کیلیک کرد براش یک اپ رو باز کنیم یا یک صفحه بغییر از اپ مربوطه؟؟؟
ممنون
سلام وقت بخیر
برای این کار Intent خودتون رو مشخص میکنین که میخواهید بعد از کلیک کاربر به کجا هدایت بشه.
مثال:
NotificationManager notificationManager = (NotificationManager) context
.getSystemService(Context.NOTIFICATION_SERVICE);
Notification notification = new Notification(icon, message, when);
Intent notificationIntent = new Intent(context, HomeActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent intent = PendingIntent.getActivity(context, 0,
notificationIntent, 0);
notification.setLatestEventInfo(context, title, message, intent);
notification.flags |= Notification.FLAG_AUTO_CANCEL;
notificationManager.notify(0, notification);
البته بحث Intent در سرفصل Notification اموزش داده شده که میتونین به اون سر فصل مراجعه کنین