@@ -252,17 +252,22 @@ else if( messageText.length() > 35 )
252252 .setContentTitle ( contentTitle != null ? contentTitle : template .getContentTitle () )
253253 .setSubText ( summarySubText != null ? summarySubText : template .getSummarySubText () )
254254 .setContentText ( messageText );
255-
256- String actionOnTap = (template .getActionOnTap () == null || template .getActionOnTap ().isEmpty () )
257- ?appContext .getPackageName ()
258- :template .getActionOnTap ();
259-
260- Intent notificationIntent = appContext .getPackageManager ().getLaunchIntentForPackage ( actionOnTap );
261- notificationIntent .putExtras ( newBundle );
262- notificationIntent .setFlags ( Intent .FLAG_ACTIVITY_NEW_TASK );
263-
264- PendingIntent contentIntent = PendingIntent .getActivity ( appContext , notificationId * 3 , notificationIntent , 0 );
265- notificationBuilder .setContentIntent ( contentIntent );
255+
256+ Intent notificationIntent ;
257+ if (template .getActionOnTap () == null || template .getActionOnTap ().isEmpty ())
258+ notificationIntent = appContext .getPackageManager ().getLaunchIntentForPackage (appContext .getPackageName ());
259+ else
260+ {
261+ notificationIntent = new Intent ("ActionOnTap" );
262+ notificationIntent .setClassName (appContext , template .getActionOnTap ());
263+ }
264+
265+ notificationIntent .putExtras (newBundle );
266+ notificationIntent .setFlags (Intent .FLAG_ACTIVITY_NEW_TASK );
267+ PendingIntent contentIntent = PendingIntent .getActivity (appContext , notificationId * 3 , notificationIntent , PendingIntent .FLAG_UPDATE_CURRENT );
268+
269+ // user should use messageId and tag(templateName) to cancel notification.
270+ notificationBuilder .setContentIntent (contentIntent );
266271
267272 if ( template .getActions () != null )
268273 {
0 commit comments