1 package expo.modules.notifications.notifications.interfaces; 2 3 import expo.modules.notifications.notifications.model.Notification; 4 import expo.modules.notifications.notifications.model.NotificationBehavior; 5 import expo.modules.notifications.notifications.model.NotificationContent; 6 7 /** 8 * An object capable of building a {@link Notification} based 9 * on a {@link NotificationContent} spec. 10 */ 11 public interface NotificationBuilder { 12 /** 13 * Pass in a {@link Notification} based on which the Android notification should be based. 14 * 15 * @param notification {@link Notification} on which the notification should be based. 16 * @return The same instance of {@link NotificationBuilder} updated with the notification. 17 */ setNotification(Notification notification)18 NotificationBuilder setNotification(Notification notification); 19 20 /** 21 * Pass in a {@link NotificationBehavior} if you want to override the behavior 22 * of the notification, i.e. whether it should show a heads-up alert, set badge, etc. 23 * 24 * @param behavior {@link NotificationBehavior} to which the presentation effect should conform. 25 * @return The same instance of {@link NotificationBuilder} updated with the remote message. 26 */ setAllowedBehavior(NotificationBehavior behavior)27 NotificationBuilder setAllowedBehavior(NotificationBehavior behavior); 28 29 /** 30 * Builds the Android notification based on passed in data. 31 * 32 * @return Built notification. 33 */ build()34 android.app.Notification build(); 35 } 36