Skip to content

Commit b9d77ee

Browse files
author
Helperhaps
committed
fix user status
1 parent b4be9fc commit b9d77ee

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Jiguang.JPush/DeviceClient.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,14 @@ public async Task<HttpResponse> GetUserOnlineStatusAsync(List<string> registrati
316316
throw new ArgumentException(nameof(registrationIdList));
317317

318318
var url = BASE_URL + "/v3/devices/status/";
319+
JObject jObj = new JObject
320+
{
321+
["registration_ids"] = new JArray(registrationIdList)
322+
323+
};
324+
325+
var requestContent = new StringContent(jObj.ToString(), Encoding.UTF8);
319326

320-
var requestJson = JsonConvert.SerializeObject(registrationIdList);
321-
HttpContent requestContent = new StringContent(requestJson, Encoding.UTF8);
322327
HttpResponseMessage msg = await JPushClient.HttpClient.PostAsync(url, requestContent).ConfigureAwait(false);
323328
string responseContent = await msg.Content.ReadAsStringAsync().ConfigureAwait(false);
324329
return new HttpResponse(msg.StatusCode, msg.Headers, responseContent);

Jiguang.JPush/Jiguang.JPush.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Copyright>MIT</Copyright>
1313
<PackageLicenseUrl></PackageLicenseUrl>
1414
<PackageProjectUrl>https://github.com/jpush/jpush-api-csharp-client</PackageProjectUrl>
15-
<Version>1.2.1</Version>
15+
<Version>1.2.2</Version>
1616
</PropertyGroup>
1717

1818
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|netstandard1.1|AnyCPU'">

0 commit comments

Comments
 (0)