/// <summary> /// 通过多个用户发送安卓推送 /// </summary> /// <param name="reqModel"></param> /// <returns></returns> public static bool PushNotoficationByUsers(UMengSendMsgModel reqModel) { UMengPushModel androidModel = AndroidModelInit(reqModel); UMengTools.InitPushModelByUsers(androidModel, reqModel.DeviceTokens, EquipmentTypeEnum.Android); UMengResponseModel model = UMengTools.UMengPostRequest(UMengUrlList.ApiSend, EquipmentTypeEnum.Android, androidModel); return(model != null && model.ret.Equals("SUCCESS")); }
/// <summary> /// 通过多个用户发送ios推送 /// </summary> /// <param name="reqModel"></param> /// <returns></returns> public static bool PushNotoficationByUsers(UMengSendMsgModel reqModel) { UMengPushModel iosModel = IOSModelInit(reqModel); UMengTools.InitPushModelByUsers(iosModel, reqModel.DeviceTokens, EquipmentTypeEnum.IOS); UMengResponseModel model = UMengTools.UMengPostRequest(UMengUrlList.ApiSend, EquipmentTypeEnum.IOS, iosModel); //2010:与alias对应的device_tokens为空 //在单播的时候,如果安卓的用户推送给IOS设备,则会返回2010错误 return(model != null && (model.ret.Equals("SUCCESS") || model.data.error_code == "2010")); }