Fixed onTapAction.
@@ -253,15 +253,20 @@ public class PushTemplateHelper
.setSubText( summarySubText != null ? summarySubText : template.getSummarySubText() )
.setContentText( messageText );
- String actionOnTap = (template.getActionOnTap() == null || template.getActionOnTap().isEmpty() )
- ?appContext.getPackageName()
- :template.getActionOnTap();
+ Intent notificationIntent;
+ if (template.getActionOnTap() == null || template.getActionOnTap().isEmpty())
+ notificationIntent = appContext.getPackageManager().getLaunchIntentForPackage(appContext.getPackageName());
+ else
+ {
+ notificationIntent = new Intent("ActionOnTap");
+ notificationIntent.setClassName(appContext, template.getActionOnTap());
+ }
- Intent notificationIntent = appContext.getPackageManager().getLaunchIntentForPackage( actionOnTap );
notificationIntent.putExtras(newBundle);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ PendingIntent contentIntent = PendingIntent.getActivity(appContext, notificationId * 3, notificationIntent, PendingIntent.FLAG_UPDATE_CURRENT);
- PendingIntent contentIntent = PendingIntent.getActivity( appContext, notificationId * 3, notificationIntent, 0 );
+ // user should use messageId and tag(templateName) to cancel notification.
notificationBuilder.setContentIntent(contentIntent);
if( template.getActions() != null )
