证书推送到云产品_问题详情_百度云推送_免费专业最精准的移动推送服务平台...

答:

"@type":"com.baidu.yun.push.exception.PushServerException","errorCode":30602,"errorMsg":"Request Params Not Valid, sorry your ios app not in whitelist please apply from push-support@baidu.com","requestId":2572092089,"stackTrace":[{"className":"com.baidu.yun.push.transform.PushRestResponseJsonUnmapper","fileName":"PushRestResponseJsonUnmapper.java","lineNumber":51,"methodName":"unmarshall","nativeMethod":false}

您好我也出现了这个问题,手机端用自带推送软件是可以正常接受到推送信息的。但是Java服务端推送报错。

这个是我的服务端代码:key是没有用错的。

public byte[] IOSPush(String packagename, String alias, String title, String description) {

JSONObject rt = new JSONObject();

rt.put("method", "iospush");

Appsecret _appsecret=new Appsecret();

_appsecret.setPackagename(packagename);

_appsecret.setType(false);

Appsecret appsecret=appsecretServer.findByAppId(_appsecret);

if(appsecret==null)

{

rt.put("result", false);

rt.put("msg", "不存在appid");

return rt.toString().getBytes();

}

rt.put("packageName:",appsecret.getPackagename()+" Secretkey:"+appsecret.getSecretkey()+" :"+appsecret.getApikey());

String apiKey = appsecret.getApikey();

String secretKey = appsecret.getSecretkey();

PushKeyPair pair = new PushKeyPair(apiKey, secretKey);

BaiduPushClient pushClient = new BaiduPushClient(pair,

BaiduPushConstants.CHANNEL_REST_URL);

try {

JSONObject aps = new JSONObject();

aps.put("alert",title+": "+ description);

aps.put("badge", "1");

JSONObject notification = new JSONObject();

notification.put("aps", aps);

notification.put("key1","value1");

notification.put("key2","value2");

rt.put("notification", notification);

PushMsgToSmartTagRequest request = new PushMsgToSmartTagRequest()

.addSelector(alias)

.addMsgExpires(new Integer(3600))

.addMessageType(1)

.addMessage(notification.toString())

.addDeviceType(4)

.addDeployStatus(1)

;

PushMsgToSmartTagResponse response = pushClient

.pushMsgToSmartTag(request);

} catch (PushClientException e) {

rt.put("result", false);

rt.put("msg",e );

return rt.toString().getBytes();

} catch (PushServerException e) {

rt.put("result", false);

rt.put("msg", e);

return rt.toString().getBytes();

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值