Package com.notnoop.apns

Examples of com.notnoop.apns.EnhancedApnsNotification


    @Test(timeout = 5000)
    public void testProducer() 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.messages.acquire();
        assertArrayEquals(apnsNotification.marshall(), server.received.toByteArray());
    }
View Full Code Here


    @Test(timeout = 5000)
    public void testProducer() 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.messages.acquire();
        assertArrayEquals(apnsNotification.marshall(), server.received.toByteArray());
    }
View Full Code Here

    @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.messages.acquire();
        assertArrayEquals(apnsNotification.marshall(), server.received.toByteArray());
    }
View Full Code Here

    public AbstractApnsService(ApnsFeedbackConnection feedback) {
        this.feedback = feedback;
    }

    public void push(String deviceToken, String payload) throws NetworkIOException {
        push(new EnhancedApnsNotification(c.incrementAndGet(), EnhancedApnsNotification.MAXIMUM_EXPIRY, deviceToken, payload));
    }
View Full Code Here

    public void push(String deviceToken, String payload) throws NetworkIOException {
        push(new EnhancedApnsNotification(c.incrementAndGet(), EnhancedApnsNotification.MAXIMUM_EXPIRY, deviceToken, payload));
    }

    public void push(String deviceToken, String payload, Date expiry) throws NetworkIOException {
        push(new EnhancedApnsNotification(c.incrementAndGet(), (int)(expiry.getTime() / 1000), deviceToken, payload));
    }
View Full Code Here

    public void push(String deviceToken, String payload, Date expiry) throws NetworkIOException {
        push(new EnhancedApnsNotification(c.incrementAndGet(), (int)(expiry.getTime() / 1000), deviceToken, payload));
    }

    public void push(byte[] deviceToken, byte[] payload) throws NetworkIOException {
        push(new EnhancedApnsNotification(c.incrementAndGet(), EnhancedApnsNotification.MAXIMUM_EXPIRY, deviceToken, payload));
    }
View Full Code Here

    public void push(byte[] deviceToken, byte[] payload) throws NetworkIOException {
        push(new EnhancedApnsNotification(c.incrementAndGet(), EnhancedApnsNotification.MAXIMUM_EXPIRY, deviceToken, payload));
    }

    public void push(byte[] deviceToken, byte[] payload, int expiry) throws NetworkIOException {
        push(new EnhancedApnsNotification(c.incrementAndGet(), expiry, deviceToken, payload));
    }
View Full Code Here

    public void push(Collection<String> deviceTokens, String payload) throws NetworkIOException {
        byte[] messageBytes = Utilities.toUTF8Bytes(payload);
        for (String deviceToken : deviceTokens) {
            byte[] dtbytes = Utilities.decodeHex(deviceToken);
            push(new EnhancedApnsNotification(c.incrementAndGet(), EnhancedApnsNotification.MAXIMUM_EXPIRY, dtbytes, messageBytes));
        }
    }
View Full Code Here

    public void push(Collection<String> deviceTokens, String payload, Date expiry) throws NetworkIOException {
        byte[] messageBytes = Utilities.toUTF8Bytes(payload);
        for (String deviceToken : deviceTokens) {
            byte[] dtbytes = Utilities.decodeHex(deviceToken);
            push(new EnhancedApnsNotification(c.incrementAndGet(),
                    (int)(expiry.getTime() / 1000), dtbytes, messageBytes));
        }
    }
View Full Code Here

        }
    }

    public void push(Collection<byte[]> deviceTokens, byte[] payload) throws NetworkIOException {
        for (byte[] deviceToken : deviceTokens) {
            push(new EnhancedApnsNotification(c.incrementAndGet(), EnhancedApnsNotification.MAXIMUM_EXPIRY, deviceToken, payload));
        }
    }
View Full Code Here

TOP

Related Classes of com.notnoop.apns.EnhancedApnsNotification

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.