Package com.dbay.apns4j.model

Examples of com.dbay.apns4j.model.Payload


    IApnsService service = getApnsService();
   
    // send notification
    String token = "94c4764e4645f42a7b2052692c8b5b41f9d5c925876e11fec5721e9045ee4e5b";
   
    Payload payload = new Payload();
    payload.setAlert("How are you?");
    // If this property is absent, the badge is not changed. To remove the badge, set the value of this property to 0
    payload.setBadge(1);
    // set sound null, the music won't be played
//    payload.setSound(null);
    payload.setSound("msg.mp3");
    payload.addParam("uid", 123456);
    payload.addParam("type", 12);
    service.sendNotification(token, payload);
   
    // payload, use loc string
    Payload payload2 = new Payload();
    payload2.setBadge(1);
    payload2.setAlertLocKey("GAME_PLAY_REQUEST_FORMAT");
    payload2.setAlertLocArgs(new String[]{"Jenna", "Frank"});
    service.sendNotification(token, payload2);
   
    // get feedback
    List<Feedback> list = service.getFeedbacks();
    if (list != null && list.size() > 0) {
View Full Code Here

TOP

Related Classes of com.dbay.apns4j.model.Payload

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.