Skip to content

Commit 17af03d

Browse files
UserId intro to config and build support for .net 4.8 and net 6.0 (#149)
* Added UserId to PNConfig * Added GetCurrentUserId() method. * .Net Framework 4.8 build support * Added support for net6.0
1 parent 6d9ec01 commit 17af03d

File tree

74 files changed

+1002
-667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1002
-667
lines changed

.github/workflows/release.yml

+4
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ jobs:
4747
uses: actions/setup-dotnet@v1
4848
with:
4949
dotnet-version: 5.0.x
50+
- name: Setup .NET 6.0.x
51+
uses: actions/setup-dotnet@v1
52+
with:
53+
dotnet-version: 6.0.x
5054
- name: Build packages
5155
env:
5256
WORKSPACE_PATH: ${{ github.workspace }}

.github/workflows/run-tests.yml

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
uses: actions/setup-dotnet@v1
2424
with:
2525
dotnet-version: 5.0.x
26+
- name: Setup .NET 6.0.x
27+
uses: actions/setup-dotnet@v1
28+
with:
29+
dotnet-version: 6.0.x
2630
- name: Build packages
2731
env:
2832
WORKSPACE_PATH: ${{ github.workspace }}

.github/workflows/run_acceptance_tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ jobs:
3333
with:
3434
token: ${{ secrets.GH_TOKEN }}
3535

36-
- name: Setup .NET 5.0.x
36+
- name: Setup .NET 6.0.x
3737
uses: actions/setup-dotnet@v1
3838
with:
39-
dotnet-version: 5.0.x
39+
dotnet-version: 6.0.x
4040
- name: Restore dependencies
4141
run: dotnet restore
4242
- name: Build Projects

.pubnub.yml

+27-61
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
name: c-sharp
2-
version: "6.5.0"
2+
version: "6.6.0"
33
schema: 1
44
scm: github.com/pubnub/c-sharp
55
changelog:
6+
- date: 2022-07-18
7+
version: v6.6.0
8+
changes:
9+
- type: improvement
10+
text: "Introduced UserId to PNConfiguration and deprecated UUID."
11+
- type: improvement
12+
text: "Added build target framework support to .Net Framework 4.8 and .Net 6.0."
613
- date: 2022-06-14
714
version: v6.5.0
815
changes:
@@ -653,7 +660,7 @@ features:
653660
- QUERY-PARAM
654661
supported-platforms:
655662
-
656-
version: Pubnub 'C#' 6.5.0
663+
version: Pubnub 'C#' 6.6.0
657664
platforms:
658665
- Windows 10 and up
659666
- Windows Server 2008 and up
@@ -663,7 +670,7 @@ supported-platforms:
663670
- .Net Framework 4.5
664671
- .Net Framework 4.6.1+
665672
-
666-
version: PubnubPCL 'C#' 6.5.0
673+
version: PubnubPCL 'C#' 6.6.0
667674
platforms:
668675
- Xamarin.Android
669676
- Xamarin.iOS
@@ -681,8 +688,9 @@ supported-platforms:
681688
- .Net Standard 2.0
682689
- .Net Standard 2.1
683690
- .Net Core
691+
- .Net 6.0
684692
-
685-
version: PubnubUWP 'C#' 6.5.0
693+
version: PubnubUWP 'C#' 6.6.0
686694
platforms:
687695
- Windows Phone 10
688696
- Universal Windows Apps
@@ -706,7 +714,7 @@ sdks:
706714
distribution-type: source
707715
distribution-repository: GitHub
708716
package-name: Pubnub
709-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.5.0.0
717+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.6.0.0
710718
requires:
711719
-
712720
name: ".Net"
@@ -722,18 +730,11 @@ sdks:
722730
license-url: "https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/LICENSE.md"
723731
location: "External"
724732
is-required: "Required"
725-
-
726-
name: "Portable.BouncyCastle"
727-
min-version: "1.8.1.2"
728-
license: "MIT,X11"
729-
license-url: "https://www.nuget.org/packages/Portable.BouncyCastle/1.8.1.2"
730-
location: "External"
731-
is-required: "Required"
732733
-
733734
name: "PeterO.Cbor"
734-
min-version: "4.4.4"
735+
min-version: "4.5.2"
735736
license: "CC0-1.0"
736-
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.4.4"
737+
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.5.2"
737738
location: "External"
738739
is-required: "Required"
739740
-
@@ -868,18 +869,11 @@ sdks:
868869
license-url: "https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/LICENSE.md"
869870
location: "External"
870871
is-required: "Required"
871-
-
872-
name: "Portable.BouncyCastle"
873-
min-version: "1.8.1.2"
874-
license: "MIT,X11"
875-
license-url: "https://www.nuget.org/packages/Portable.BouncyCastle/1.8.1.2"
876-
location: "External"
877-
is-required: "Required"
878872
-
879873
name: "PeterO.Cbor"
880-
min-version: "4.4.4"
874+
min-version: "4.5.2"
881875
license: "CC0-1.0"
882-
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.4.4"
876+
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.5.2"
883877
location: "External"
884878
is-required: "Required"
885879
-
@@ -1003,7 +997,7 @@ sdks:
1003997
distribution-type: source
1004998
distribution-repository: GitHub
1005999
package-name: PubNubPCL
1006-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.5.0.0
1000+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.6.0.0
10071001
requires:
10081002
-
10091003
name: ".Net Core"
@@ -1019,18 +1013,11 @@ sdks:
10191013
license-url: "https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/LICENSE.md"
10201014
location: "External"
10211015
is-required: "Required"
1022-
-
1023-
name: "Portable.BouncyCastle"
1024-
min-version: "1.8.1.2"
1025-
license: "MIT,X11"
1026-
license-url: "https://www.nuget.org/packages/Portable.BouncyCastle/1.8.1.2"
1027-
location: "External"
1028-
is-required: "Required"
10291016
-
10301017
name: "PeterO.Cbor"
1031-
min-version: "4.4.4"
1018+
min-version: "4.5.2"
10321019
license: "CC0-1.0"
1033-
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.4.4"
1020+
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.5.2"
10341021
location: "External"
10351022
is-required: "Required"
10361023
supported-platforms:
@@ -1204,18 +1191,11 @@ sdks:
12041191
license-url: "https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/LICENSE.md"
12051192
location: "External"
12061193
is-required: "Required"
1207-
-
1208-
name: "Portable.BouncyCastle"
1209-
min-version: "1.8.1.2"
1210-
license: "MIT,X11"
1211-
license-url: "https://www.nuget.org/packages/Portable.BouncyCastle/1.8.1.2"
1212-
location: "External"
1213-
is-required: "Required"
12141194
-
12151195
name: "PeterO.Cbor"
1216-
min-version: "4.4.4"
1196+
min-version: "4.5.2"
12171197
license: "CC0-1.0"
1218-
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.4.4"
1198+
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.5.2"
12191199
location: "External"
12201200
is-required: "Required"
12211201
supported-platforms:
@@ -1376,7 +1356,7 @@ sdks:
13761356
distribution-type: source
13771357
distribution-repository: GitHub
13781358
package-name: PubnubUWP
1379-
location: https://github.com/pubnub/c-sharp/releases/tag/v6.5.0.0
1359+
location: https://github.com/pubnub/c-sharp/releases/tag/v6.6.0.0
13801360
requires:
13811361
-
13821362
name: "Universal Windows Platform Development"
@@ -1399,18 +1379,11 @@ sdks:
13991379
license-url: "https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/LICENSE.md"
14001380
location: "External"
14011381
is-required: "Required"
1402-
-
1403-
name: "Portable.BouncyCastle"
1404-
min-version: "1.8.1.2"
1405-
license: "MIT,X11"
1406-
license-url: "https://www.nuget.org/packages/Portable.BouncyCastle/1.8.1.2"
1407-
location: "External"
1408-
is-required: "Required"
14091382
-
14101383
name: "PeterO.Cbor"
1411-
min-version: "4.4.4"
1384+
min-version: "4.5.2"
14121385
license: "CC0-1.0"
1413-
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.4.4"
1386+
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.5.2"
14141387
location: "External"
14151388
is-required: "Required"
14161389
supported-platforms:
@@ -1493,18 +1466,11 @@ sdks:
14931466
license-url: "https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/LICENSE.md"
14941467
location: "External"
14951468
is-required: "Required"
1496-
-
1497-
name: "Portable.BouncyCastle"
1498-
min-version: "1.8.1.2"
1499-
license: "MIT,X11"
1500-
license-url: "https://www.nuget.org/packages/Portable.BouncyCastle/1.8.1.2"
1501-
location: "External"
1502-
is-required: "Required"
15031469
-
15041470
name: "PeterO.Cbor"
1505-
min-version: "4.4.4"
1471+
min-version: "4.5.2"
15061472
license: "CC0-1.0"
1507-
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.4.4"
1473+
license-url: "https://www.nuget.org/packages/PeterO.Cbor/4.5.2"
15081474
location: "External"
15091475
is-required: "Required"
15101476
supported-platforms:

CHANGELOG

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v6.6.0 - July 18 2022
2+
-----------------------------
3+
- Modified: introduced UserId to PNConfiguration and deprecated UUID.
4+
- Modified: added build target framework support to .Net Framework 4.8 and .Net 6.0.
5+
16
v6.5.0 - June 14 2022
27
-----------------------------
38
- Fixed: suppress web request aborted exception message to callback.

src/Api/PubnubApi/Builder/UrlRequestBuilder.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2038,7 +2038,7 @@ private Dictionary<string, string> GenerateCommonQueryParams(PNOperationType typ
20382038
{
20392039
if (pubnubUnitTest.IncludeUuid)
20402040
{
2041-
ret.Add("uuid", UriUtil.EncodeUriComponent(pubnubConfig[pubnubInstanceId].Uuid, PNOperationType.PNSubscribeOperation, false, false, true));
2041+
ret.Add("uuid", UriUtil.EncodeUriComponent(pubnubConfig[pubnubInstanceId].UserId, PNOperationType.PNSubscribeOperation, false, false, true));
20422042
}
20432043

20442044
if (pubnubUnitTest.IncludePnsdk)
@@ -2049,7 +2049,7 @@ private Dictionary<string, string> GenerateCommonQueryParams(PNOperationType typ
20492049
else
20502050
{
20512051
ret.Add("uuid", UriUtil.EncodeUriComponent(uuid != null ? uuid :
2052-
(pubnubConfig.ContainsKey(pubnubInstanceId) ? pubnubConfig[pubnubInstanceId].Uuid : ""),
2052+
(pubnubConfig.ContainsKey(pubnubInstanceId) ? pubnubConfig[pubnubInstanceId].UserId.ToString() : ""),
20532053
PNOperationType.PNSubscribeOperation, false, false, true));
20542054
ret.Add("pnsdk", UriUtil.EncodeUriComponent(Pubnub.Version, PNOperationType.PNSubscribeOperation, false, false, true));
20552055
}

src/Api/PubnubApi/ClientNetworkStatus.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Threading.Tasks;
55
using System.IO;
66
using System.Globalization;
7-
#if !NET35 && !NET40 && !NET45 && !NET461 && !NETSTANDARD10
7+
#if !NET35 && !NET40 && !NET45 && !NET461 && !NET48 && !NETSTANDARD10
88
using System.Net.Http;
99
using System.Net.Http.Headers;
1010
#endif
@@ -20,7 +20,7 @@ internal static class ClientNetworkStatus
2020
private static IPubnubLog pubnubLog;
2121

2222
private static bool networkStatus = true;
23-
#if !NET35 && !NET40 && !NET45 && !NET461 && !NETSTANDARD10
23+
#if !NET35 && !NET40 && !NET45 && !NET461 && !NET48 && !NETSTANDARD10
2424
private static HttpClient httpClient;
2525
#endif
2626

@@ -72,7 +72,7 @@ public static IPubnubLog PubnubLog
7272
}
7373
}
7474

75-
#if !NET35 && !NET40 && !NET45 && !NET461 && !NETSTANDARD10
75+
#if !NET35 && !NET40 && !NET45 && !NET461 && !NET48 && !NETSTANDARD10
7676
public static HttpClient RefHttpClient
7777
{
7878
set
@@ -221,7 +221,7 @@ private static async Task<bool> CheckSocketConnect<T>(object internetState)
221221
}
222222
else
223223
{
224-
#if !NET35 && !NET40 && !NET45 && !NET461 && !NETSTANDARD10
224+
#if !NET35 && !NET40 && !NET45 && !NET461 && !NET48 && !NETSTANDARD10
225225
if (pubnubConfig.UseTaskFactoryAsyncInsteadOfHttpClient)
226226
{
227227
gotTimeResp = await GetTimeWithTaskFactoryAsync(requestUri).ConfigureAwait(false);
@@ -271,7 +271,7 @@ private static void ParseCheckSocketConnectException<T>(Exception ex, PNOperatio
271271
internalcallback(false);
272272
}
273273

274-
#if !NET35 && !NET40 && !NET45 && !NET461 && !NETSTANDARD10
274+
#if !NET35 && !NET40 && !NET45 && !NET461 && !NET48 && !NETSTANDARD10
275275
private static async Task<bool> GetTimeWithHttpClient(Uri requestUri)
276276
{
277277
bool successFlag = false;
@@ -347,7 +347,7 @@ private static async Task<bool> GetTimeWithClassicHttp<T>(Uri requestUri)
347347
}
348348
if (asyncRequestState.Response != null)
349349
{
350-
#if NET35 || NET40 || NET45 || NET461
350+
#if NET35 || NET40 || NET45 || NET461 || NET48
351351
pubnubRequestState.Response.Close();
352352
#endif
353353
asyncRequestState.Response = null;

src/Api/PubnubApi/EndPoint/Files/SendFileOperation.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ private static byte[] GetMultipartFormData(byte[] sendFileByteArray, string file
487487
ret = new byte[dataStream.Length];
488488
int bytesRead = dataStream.Read(ret, 0, ret.Length);
489489
System.Diagnostics.Debug.WriteLine(string.Format("MultipartFormData byte count = {0}", bytesRead));
490-
#if NET35 || NET40 || NET45 || NET461
490+
#if NET35 || NET40 || NET45 || NET461 || NET48
491491
dataStream.Close();
492492
#endif
493493
}

src/Api/PubnubApi/EndPoint/Objects/GetMembershipsOperation.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private void GetMembershipsList(string uuid, PNPageObject page, int limit, bool
152152
{
153153
if (string.IsNullOrEmpty(uuid))
154154
{
155-
uuid = config.Uuid;
155+
uuid = config.UserId;
156156
}
157157

158158
PNPageObject internalPage;
@@ -195,7 +195,7 @@ private async Task<PNResult<PNMembershipsResult>> GetMembershipsList(string uuid
195195

196196
if (string.IsNullOrEmpty(uuid))
197197
{
198-
uuid = config.Uuid;
198+
uuid = config.UserId;
199199
}
200200

201201
PNPageObject internalPage;

src/Api/PubnubApi/EndPoint/Objects/GetUuidMetadataOperation.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private void GetSingleUuidMetadata(string uuid, bool includeCustom, Dictionary<s
113113
}
114114
if (string.IsNullOrEmpty(uuid))
115115
{
116-
uuid = config.Uuid;
116+
uuid = config.UserId;
117117
}
118118

119119
IUrlRequestBuilder urlBuilder = new UrlRequestBuilder(config, jsonLibrary, unit, pubnubLog, pubnubTelemetryMgr, (PubnubInstance != null && !string.IsNullOrEmpty(PubnubInstance.InstanceId) && PubnubTokenMgrCollection.ContainsKey(PubnubInstance.InstanceId)) ? PubnubTokenMgrCollection[PubnubInstance.InstanceId] : null, (PubnubInstance != null) ? PubnubInstance.InstanceId : "");
@@ -149,7 +149,7 @@ private async Task<PNResult<PNGetUuidMetadataResult>> GetSingleUuidMetadata(stri
149149
{
150150
if (string.IsNullOrEmpty(uuid))
151151
{
152-
uuid = config.Uuid;
152+
uuid = config.UserId;
153153
}
154154
PNResult<PNGetUuidMetadataResult> ret = new PNResult<PNGetUuidMetadataResult>();
155155

src/Api/PubnubApi/EndPoint/Objects/ManageMembershipsOperation.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ private void ManageChannelMembershipWithUuid(string uuid, List<PNMembership> set
166166
{
167167
if (string.IsNullOrEmpty(uuid))
168168
{
169-
uuid = config.Uuid;
169+
uuid = config.UserId;
170170
}
171171

172172
PNPageObject internalPage;
@@ -246,7 +246,7 @@ private async Task<PNResult<PNMembershipsResult>> ManageChannelMembershipWithUui
246246

247247
if (string.IsNullOrEmpty(uuid))
248248
{
249-
uuid = config.Uuid;
249+
uuid = config.UserId;
250250
}
251251

252252
if (string.IsNullOrEmpty(config.SubscribeKey) || string.IsNullOrEmpty(config.SubscribeKey.Trim()) || config.SubscribeKey.Length <= 0)

src/Api/PubnubApi/EndPoint/Objects/RemoveMembershipsOperation.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private void RemoveUuidMemberships(string uuid, List<string> removeMembership, P
158158
{
159159
if (string.IsNullOrEmpty(uuid))
160160
{
161-
uuid = config.Uuid;
161+
uuid = config.UserId;
162162
}
163163

164164
PNPageObject internalPage;
@@ -220,7 +220,7 @@ private async Task<PNResult<PNMembershipsResult>> RemoveUuidMemberships(string u
220220

221221
if (string.IsNullOrEmpty(uuid))
222222
{
223-
uuid = config.Uuid;
223+
uuid = config.UserId;
224224
}
225225

226226
if (string.IsNullOrEmpty(config.SubscribeKey) || string.IsNullOrEmpty(config.SubscribeKey.Trim()) || config.SubscribeKey.Length <= 0)

0 commit comments

Comments
 (0)