The redirection works fine, but the redirection does not happen if the Push Notification is clicked immediately like within 2 seconds or so. The second time I made sure to wait anywhere around 10-15 seconds and that time it worked fine. Can anyone help me out how to solve this problem.
Notification notification;
Intent notificationIntent = BMSNotificationIntent.getNotificationIntent(notificationData, mContext,
mSharedPreferencesManager, true);
notificationIntent.putExtras(rawNotificaionData);
PendingIntent NotificationPendingIntent = PendingIntent.getActivity(mContext, 0, notificationIntent,
PendingIntent.FLAG_UPDATE_CURRENT);
NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(mContext);
notificationBuilder.setPriority(Notification.PRIORITY_MAX);
notificationBuilder
.setSmallIcon(R.drawable.status_icon)
.setColor(ContextCompat.getColor(mContext, R.color.transparent))
.setContentIntent(NotificationPendingIntent)
.setTicker(notificationData.getCleverTapTitle())
.setAutoCancel(isAutoCancelable())
.setContentTitle(notificationData.getCleverTapTitle())
.setContentText(notificationData.getCleverTapMessage())
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setDefaults(NotificationCompat.DEFAULT_VIBRATE | NotificationCompat.DEFAULT_SOUND);
notificationBuilder.setDefaults(Notification.DEFAULT_SOUND);
notificationBuilder.setChannelId(NotificationChannelName.GENERAL);
/*Create a Delete Intent that will be called when user removes the notification by swiping or by clear*/
notificationBuilder.setDeleteIntent(getNotificationDeletePendingIntent());
notification = notificationBuilder.build();
notification.flags |= NotificationCompat.FLAG_AUTO_CANCEL;
if (BMSUiUtility.isNotificationFromInbox(rawNotificaionData, mSharedPreferencesManager)) {
mNotificationManager.notify(notificationId, notification);
} else {
mNotificationManager.notify(0, notification);
}