|
|
|
@ -7,13 +7,8 @@ import com.getui.push.v2.sdk.GtApiConfiguration; |
|
|
|
|
import com.getui.push.v2.sdk.api.PushApi; |
|
|
|
|
import com.getui.push.v2.sdk.common.ApiResult; |
|
|
|
|
import com.getui.push.v2.sdk.dto.req.Audience; |
|
|
|
|
import com.getui.push.v2.sdk.dto.req.message.PushChannel; |
|
|
|
|
import com.getui.push.v2.sdk.dto.req.message.PushDTO; |
|
|
|
|
import com.getui.push.v2.sdk.dto.req.message.PushMessage; |
|
|
|
|
import com.getui.push.v2.sdk.dto.req.message.android.AndroidDTO; |
|
|
|
|
import com.getui.push.v2.sdk.dto.req.message.android.GTNotification; |
|
|
|
|
import com.getui.push.v2.sdk.dto.req.message.android.ThirdNotification; |
|
|
|
|
import com.getui.push.v2.sdk.dto.req.message.android.Ups; |
|
|
|
|
import org.slf4j.Logger; |
|
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
|
|
|
@ -68,30 +63,7 @@ public class UniPushService { |
|
|
|
|
// 设置个推通道参数
|
|
|
|
|
PushMessage pushMessage = new PushMessage(); |
|
|
|
|
pushDTO.setPushMessage(pushMessage); |
|
|
|
|
|
|
|
|
|
// 个推推送消息参数
|
|
|
|
|
GTNotification notification = new GTNotification(); |
|
|
|
|
pushMessage.setNotification(notification); |
|
|
|
|
notification.setTitle("惠支付"); |
|
|
|
|
notification.setBody(object.getString("body")); |
|
|
|
|
notification.setClickType("startapp"); |
|
|
|
|
|
|
|
|
|
/**** 设置厂商相关参数 ****/ |
|
|
|
|
PushChannel pushChannel = new PushChannel(); |
|
|
|
|
pushDTO.setPushChannel(pushChannel); |
|
|
|
|
/*配置安卓厂商参数*/ |
|
|
|
|
AndroidDTO androidDTO = new AndroidDTO(); |
|
|
|
|
pushChannel.setAndroid(androidDTO); |
|
|
|
|
Ups ups = new Ups(); |
|
|
|
|
androidDTO.setUps(ups); |
|
|
|
|
ThirdNotification thirdNotification = new ThirdNotification(); |
|
|
|
|
ups.setNotification(thirdNotification); |
|
|
|
|
thirdNotification.setTitle("T惠支付"); |
|
|
|
|
thirdNotification.setBody(object.getString("body")); |
|
|
|
|
thirdNotification.setClickType("startapp"); |
|
|
|
|
/*配置安卓厂商参数结束,更多参数请查看文档或对象源码*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pushMessage.setTransmission(object.getString("body")); |
|
|
|
|
/*设置接收人信息*/ |
|
|
|
|
Audience audience = new Audience(); |
|
|
|
|
pushDTO.setAudience(audience); |
|
|
|
|