Skip to content

Commit 1c816f5

Browse files
author
Hevin
committed
Merge branch 'v2-dev'
2 parents 9d05859 + 40cf619 commit 1c816f5

File tree

5 files changed

+69
-44
lines changed

5 files changed

+69
-44
lines changed

.vs/cn.jpush.api/v14/.suo

-267 KB
Binary file not shown.

Jiguang.JPush/JPushClient.cs

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ namespace Jiguang.JPush
99
{
1010
public class JPushClient
1111
{
12-
private const string BASE_URL = "https://api.jpush.cn/v3/push";
12+
public const string BASE_URL_DEFAULT = "https://api.jpush.cn/v3/push";
13+
public const string BASE_URL_BEIJING = "https://bjapi.push.jiguang.cn/v3/push";
14+
15+
private string BASE_URL = BASE_URL_DEFAULT;
1316

1417
public DeviceClient Device;
1518
public ScheduleClient Schedule;
1619
private ReportClient report;
1720

1821
public ReportClient Report { get => report; set => report = value; }
1922

20-
public static readonly HttpClient HttpClient;
23+
public static HttpClient HttpClient;
2124

2225
static JPushClient()
2326
{
@@ -39,6 +42,21 @@ public JPushClient(string appKey, string masterSecret)
3942
Report = new ReportClient();
4043
Device = new DeviceClient();
4144
Schedule = new ScheduleClient();
45+
}
46+
47+
/// <summary>
48+
/// 设置 API 调用地址。
49+
/// <para>
50+
/// 如果极光应用分配在北京机房(极光控制台 “应用设置” -> “应用信息” 中可以看到),并且开发者接口调用的服务器也位于北京,则可以调用如下地址:
51+
///
52+
/// https://bjapi.push.jiguang.cn/v3/push
53+
/// <para>可以提升 API 的响应速度。</para>
54+
/// </para>
55+
/// </summary>
56+
/// <param name="url"><see cref="BASE_URL_DEFAULT"/> or <see cref="BASE_URL_BEIJING"/></param>
57+
public void SetBaseURL(string url)
58+
{
59+
BASE_URL = url;
4260
}
4361

4462
public async Task<HttpResponse> SendPushAsync(string jsonBody)

Jiguang.JPush/Jiguang.JPush.csproj

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,27 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
2-
3-
<PropertyGroup>
4-
<TargetFrameworks Condition="'$(LibraryFrameworks)'==''">netstandard1.1;netstandard1.3;net45;net46</TargetFrameworks>
5-
<TargetFrameworks Condition="'$(LibraryFrameworks)'!=''">$(LibraryFrameworks)</TargetFrameworks>
6-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
7-
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
8-
<Description>The CSharp api client by Jiguang.</Description>
9-
<Authors>hevin, Jiguang</Authors>
10-
<Company>cn.jiguang</Company>
11-
<Product>JPush</Product>
12-
<Copyright>MIT</Copyright>
13-
<PackageLicenseUrl></PackageLicenseUrl>
14-
<Version>1.1.0</Version>
15-
</PropertyGroup>
16-
17-
<ItemGroup>
18-
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
19-
</ItemGroup>
20-
21-
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
22-
<PackageReference Include="System.Net.Http">
23-
<Version>4.0.0</Version>
24-
</PackageReference>
25-
26-
<PackageReference Include="System.Threading">
27-
<Version>4.0.0</Version>
28-
</PackageReference>
29-
</ItemGroup>
30-
31-
<ItemGroup Condition="'$(TargetFramework)' == 'net46'">
32-
<PackageReference Include="System.Net.Http">
33-
<Version>4.1.0</Version>
34-
</PackageReference>
35-
36-
<PackageReference Include="System.Threading">
37-
<Version>4.0.0</Version>
38-
</PackageReference>
39-
</ItemGroup>
40-
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks Condition="'$(LibraryFrameworks)'==''">netstandard1.1;net45</TargetFrameworks>
5+
<TargetFrameworks Condition="'$(LibraryFrameworks)'!=''">$(LibraryFrameworks)</TargetFrameworks>
6+
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
7+
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
8+
<Description>The CSharp api client by Jiguang.</Description>
9+
<Authors>hevin, Jiguang</Authors>
10+
<Company>cn.jiguang</Company>
11+
<Product>JPush</Product>
12+
<Copyright>MIT</Copyright>
13+
<PackageLicenseUrl></PackageLicenseUrl>
14+
<PackageProjectUrl>https://github.com/jpush/jpush-api-csharp-client</PackageProjectUrl>
15+
<Version>1.1.1</Version>
16+
</PropertyGroup>
17+
18+
<ItemGroup>
19+
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
20+
</ItemGroup>
21+
22+
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
23+
<Reference Include="System.Net.Http" />
24+
<Reference Include="System.Threading" />
25+
</ItemGroup>
26+
4127
</Project>

Jiguang.JPush/Model/Notification.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,28 @@ public class Android
5151
public string BigPicturePath { get; set; }
5252

5353
[JsonProperty("extras")]
54-
public Dictionary<string, object> Extras { get; set; }
54+
public Dictionary<string, object> Extras { get; set; }
55+
56+
// VIP only - start
57+
/// <summary>
58+
/// (VIP only)指定开发者想要打开的 Activity,值为 <activity> 节点的 "android:name" 属性值。
59+
/// </summary>
60+
[JsonProperty("url_activity")]
61+
public string URLActivity { get; set; }
62+
63+
/// <summary>
64+
/// (VIP only)指定打开 Activity 的方式,值为 Intent.java 中预定义的 "access flags" 的取值范围。
65+
/// </summary>
66+
[JsonProperty("url_flag")]
67+
public string URLFlag { get; set; }
68+
69+
/// <summary>
70+
/// (VIP only)指定开发者想要打开的 Activity,值为 <activity> -> <intent-filter> -> <action> 节点中的 "android:name" 属性值。
71+
/// </summary>
72+
[JsonProperty("uri_action")]
73+
public string URIAction { get; set; }
74+
75+
// VIP only - end
5576
}
5677

5778
public class IOS

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# JPush Library for .NET
22

3-
[![NuGet](https://img.shields.io/badge/NuGet-v1.1.0-blue.svg)](https://preview.nuget.org/packages/Jiguang.JPush/)
3+
[![NuGet](https://img.shields.io/badge/NuGet-v1.1.1-blue.svg)](https://preview.nuget.org/packages/Jiguang.JPush/)
44

55
[极光](https://www.jiguang.cn/)官方支持的 JPush .NET API Client。
66

0 commit comments

Comments
 (0)