只需一步,快速开始
升级 29.67%
83
举人
aps_developer_identity
http://code.google.com/p/javapns/
import org.json.JSONException; import javapns.back.PushNotificationManager; import javapns.back.SSLConnectionHelper; import javapns.data.Device; import javapns.data.PayLoad; public class Main { /** * @param args * @throws Exception */ public static void main(String[] args) throws Exception { PayLoad simplePayLoad = new PayLoad(); // Get PushNotification Instance PushNotificationManager pushManager = PushNotificationManager.getInstance(); // Link iPhone’s UDID (64-char device token) to a stringName pushManager.addDevice("iPhone", "00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 "); simplePayLoad.addAlert("My alert message测试"); simplePayLoad.addBadge(1); simplePayLoad.addSound("default"); Device client = PushNotificationManager.getInstance().getDevice("iPhone"); PushNotificationManager.getInstance().initializeConnection("gateway.sandbox.push.apple.com", 2195, "/home/ubuntu/mypush.p12", "password", SSLConnectionHelper.KEYSTORE_TYPE_PKCS12); PushNotificationManager.getInstance().sendNotification(client, simplePayLoad);
http://code.google.com/p/php-apns
使用道具 举报
本版积分规则 发表回复 回帖后跳转到最后一页