use of com.notnoop.apns.EnhancedApnsNotification in project java-apns by notnoop.
the class AbstractApnsService method push.
public EnhancedApnsNotification push(byte[] deviceToken, byte[] payload, int expiry) throws NetworkIOException {
EnhancedApnsNotification notification = new EnhancedApnsNotification(c.incrementAndGet(), expiry, deviceToken, payload);
push(notification);
return notification;
}
use of com.notnoop.apns.EnhancedApnsNotification in project camel by apache.
the class ApnsProducerWithoutTokensHeaderTest method testProducerWithoutTokenHeader.
@Test(timeout = 5000)
public void testProducerWithoutTokenHeader() throws Exception {
String message = "Hello World";
String messagePayload = APNS.newPayload().alertBody(message).build();
EnhancedApnsNotification apnsNotification = new EnhancedApnsNotification(1, EnhancedApnsNotification.MAXIMUM_EXPIRY, FAKE_TOKEN, messagePayload);
server.stopAt(apnsNotification.length());
template.sendBody("direct:test", message);
server.getMessages().acquire();
assertArrayEquals(apnsNotification.marshall(), server.getReceived().toByteArray());
}
Aggregations