极光推送,报错,为什么

dongchaofsdfds dongchaofsdfds 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
public static void main(String[] args) {
// testSendPush();
String masterSecret = "注册的,可以使用的";
// 应用的appKey,同样在网站上申请
String appKey = "注册的,可以使用的";
// 建立JpushClient类,用来发送消息的对象
JPushClient client = new JPushClient(masterSecret, appKey);
try {
// client.sendNotificationAll("hello world");

// client.sendMessageAll("this is a message");
PushPayload payload = PushPayload.newBuilder().setPlatform(
Platform.android_ios()).setNotification(
Notification.alert("jPush is useful!!")).setAudience(
Audience.alias("123456")).build();//123456是alias
client.sendPush(payload);

} catch (APIConnectionException e) {
e.printStackTrace();
} catch (APIRequestException e) {
e.printStackTrace();
}

}





报错:
at cn.jpush.api.common.connection.NativeHttpClient._doRequest(NativeHttpClient.java:208)
at cn.jpush.api.common.connection.NativeHttpClient.doRequest(NativeHttpClient.java:72)
at cn.jpush.api.common.connection.NativeHttpClient.sendPost(NativeHttpClient.java:64)
at cn.jpush.api.push.PushClient.sendPush(PushClient.java:111)
at cn.jpush.api.JPushClient.sendPush(JPushClient.java:88)
at cn.jpush.api.examples.PushExample.main(PushExample.java:56)
...全文

相关推荐

评论 13
收藏 已收藏
分享
返回顶部
dongchaofsdfds
Java EE 67,535 成员 225,843 内容