C# JPushClient 调用SendPush的时候报1002,

severus
2017-11-09 10:10 1.5k 0

ios的推送是没有问题的,但安卓的就报错1002,同用的APP,通用的推送代码.
以下为推送代码,


MessageResult result=null;
                List<string> insert_list = new List<string>();
                JPushClient pushclient = new JPushClient(APP_KEY, MASTER_SECRET);
                StringBuilder sbids = new StringBuilder();
                if (ds == null) { return; }
                for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
                {
PushPayload pushpayload = new PushPayload();
pushpayload.platform = Platform.android_ios();
 pushpayload.audience = Audience.s_tag("tag_"+ds.Tables[0].Rows[j]["DEVICE_ID"].ToString());
if (push_hours > 0)
                    {
                        pushpayload.options.time_to_live = push_hours * 60;
                    }
                    else
                    {
                        if (string.IsNullOrEmpty(this.textBox2.Text)) return;
                        pushpayload.options.time_to_live = Convert.ToInt32(this.textBox2.Text);
                    }
 pushpayload.notification = new Notification().setIos(new IosNotification().setAlert("[测试]"+ds.Tables[0].Rows[j]["LOM_TITLE"].ToString()).incrBadge(1).setContentAvailable(true)
                        );
 pushpayload.options.sendno = 1440;
 try
                    {
                        result = pushclient.SendPush(pushpayload);   //发送
                    }
                    catch (APIRequestException ex)
                    {
                    }
}

以上这段为报错的地方.苹果的没有报错,安卓的就报1002.

1个回答

热门排序