| | |
| | | isProduce = false; |
| | | #endif |
| | | |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushDeviceToken)) { |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushDeviceToken)) { |
| | | Utlis.WriteLine("PushDeviceToken 为空"); |
| | | return false; |
| | | } |
| | | |
| | | var mAddpushinfoObj = new AddpushinfoObj() |
| | | { |
| | | pushToken = UserInfo.Current.PushDeviceToken, |
| | | deviceName = UserInfo.Current.PhoneName, |
| | | pushToken = OnAppConfig.Instance.PushDeviceToken, |
| | | deviceName = OnAppConfig.Instance.PhoneName, |
| | | deviceType = deviceType, |
| | | produce = isProduce, |
| | | }; |
| | |
| | | var pushId = revertObj.Data.ToString(); |
| | | if (!string.IsNullOrEmpty(pushId)) |
| | | { |
| | | UserInfo.Current.PushId = pushId; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | OnAppConfig.Instance.PushId = pushId; |
| | | OnAppConfig.Instance.SaveConfig(); |
| | | Utlis.WriteLine("PushId: " + pushId); |
| | | |
| | | return true; |
| | |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(new GetMessageListObj() |
| | | { |
| | | pushId = UserInfo.Current.PushId, |
| | | pushId = OnAppConfig.Instance.PushId, |
| | | pushType = pushType |
| | | }); |
| | | return HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Getpushmessagelist, requestJson); |
| | |
| | | /// <returns></returns> |
| | | public bool PushSerivceClearmessagelist() |
| | | { |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false; |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() |
| | | { |
| | | pushId = UserInfo.Current.PushId |
| | | pushId = OnAppConfig.Instance.PushId |
| | | }); |
| | | |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_Clearmessagelist, requestJson); |
| | |
| | | /// <returns></returns> |
| | | public bool PushSerivceSignOut() |
| | | { |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false; |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | try |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() { |
| | | pushId = UserInfo.Current.PushId |
| | | pushId = OnAppConfig.Instance.PushId |
| | | }); |
| | | |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_DeleteToken, requestJson); |
| | |
| | | /// <returns></returns> |
| | | public bool PushSerivceMarkAllMessageRead() |
| | | { |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false; |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | |
| | | try |
| | | { |
| | | var requestJson = HttpUtil.GetSignRequestJson(new PushIdObj() |
| | | { |
| | | pushId = UserInfo.Current.PushId |
| | | pushId = OnAppConfig.Instance.PushId |
| | | }); |
| | | var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_PushSerivce_ALLMarkread, requestJson); |
| | | if (revertObj.Code == StateCode.SUCCESS) |
| | |
| | | /// <returns></returns> |
| | | public bool PushSerivceMarkMessageRead(string msgId) |
| | | { |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false; |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | |
| | | try |
| | | { |
| | |
| | | /// <returns></returns> |
| | | public bool PushSerivceDeleteMessage(string msgId) |
| | | { |
| | | if (string.IsNullOrEmpty(UserInfo.Current.PushId)) return false; |
| | | if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) return false; |
| | | |
| | | try |
| | | { |