Exemple #1
0
        public static MessageResult sendPushMessage(string registrationId, string key, string secret)
        {
            //ClientConfig config = ClientConfig.getInstance();
            //jpushClient = new JPushClient(secret, key, 3, null, config);
            jpushClient = new JPushClient(key, secret);
            PushPayload payload = new PushPayload();

            payload.platform     = Platform.all();
            payload.audience     = Audience.s_registrationId(registrationId);
            payload.notification = new Notification().setAlert("亲爱的x5外卖用户,您的订单已经配货完毕,正在运送中..");

            payload.ResetOptionsTimeToLive(86400);
            payload.ResetOptionsApnsProduction(apnsProduction);
            string        schedleTime = DateTime.Today.ToString("yyyy-MM-dd HH:mm:ss");
            MessageResult result      = jpushClient.SendPush(payload);

            return(result);
        }