setTag

Sets a unique tag to identify and manage this notification.

Tags control notification replacement behavior:

  • Notifications with different tags will appear as separate notifications
  • Notifications with the same tag will replace each other (unless multi-notification mode is enabled)
This is useful for updating existing notifications or preventing notification spam. Example:

		  // First notification with tag "cart_reminder"
		  LocalNotification firstReminder = new LocalNotification.Builder()
		      .setTag("cart_reminder")
		      .setMessage("You have 3 items in your cart")
		      .setDelay(3600)
		      .build();
		  Pushwoosh.getInstance().scheduleLocalNotification(firstReminder);
		
		  // Second notification with same tag - will replace the first one
		  LocalNotification updatedReminder = new LocalNotification.Builder()
		      .setTag("cart_reminder")
		      .setMessage("You have 5 items in your cart")
		      .setDelay(7200)
		      .build();
		  Pushwoosh.getInstance().scheduleLocalNotification(updatedReminder);
		
		  // Different tag - will appear as separate notification
		  LocalNotification saleNotification = new LocalNotification.Builder()
		      .setTag("flash_sale")
		      .setMessage("Flash sale ends soon!")
		      .setDelay(1800)
		      .build();
		  Pushwoosh.getInstance().scheduleLocalNotification(saleNotification);
		

Return

this builder instance for method chaining

Parameters

tag

notification tag (should be unique per notification type)

See also