/** * Sets the notification type to a Toast notification * * @return a toast notification builder */ public ToastNotification.Builder toast() { return new ToastNotification.Builder(); }
@Override public RawNotification build() { return new RawNotification(body, headers); } }
/** * Sets the notification type to a Raw notification * * @return a row notification builder */ public RawNotification.Builder raw() { return new RawNotification.Builder(); } }
@Test public void generateValidXml() { TileNotification tile = MPNS.newNotification().tile() .count(1).title("Sample").backBackgroundImage("http://sample.com/image.png") .backTitle("Random \"asdf<>;'a") .build(); assertThat(tile.getRequestBody(), isValidXml()); } }
@Override public ToastNotification build() { return new ToastNotification(title, subtitle, parameter, headers); } }
/** * Sets the notification type to a Tile notification * * @return a tile notification builder */ public TileNotification.Builder tile() { return new TileNotification.Builder(); }
@Override public TileNotification build() { return new TileNotification(backgroundImage, title, count, backBackgroundImage, backTitle, backContent,headers); } }
public Builder() { super("toast"); contentType(Utilities.XML_CONTENT_TYPE); }
public Builder() { super("token"); // TODO: Check whether it is "tile" contentType(Utilities.XML_CONTENT_TYPE); }
protected AbstractNotificationBuilder(String type) { notificationType(type); }
/** * Sets the notification batching interval, indicating when the notification * should be delivered to the device * * @param delivery batching interval * @return this */ public A notificationClass(DeliveryClass delivery) { this.headers.add(Pair.of("X-NotificationClass", String.valueOf(deliveryValueOf(delivery)))); return (A)this; }