diff --git a/.github/workflows/release/versions.json b/.github/workflows/release/versions.json index f6832af9d..f99302d51 100644 --- a/.github/workflows/release/versions.json +++ b/.github/workflows/release/versions.json @@ -39,5 +39,12 @@ "clearedPrefix": true, "clearedSuffix": false } - ] + ], + "src/Api/PubnubApiUnity/PubnubApiUnity.csproj": [ + { + "pattern": "^\\s{2,}(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)<\/PackageVersion>$", + "clearedPrefix": true, + "clearedSuffix": false + } + ], } diff --git a/src/Api/PubnubApi/Pubnub.cs b/src/Api/PubnubApi/Pubnub.cs index 3899ed04e..4f2981ae4 100644 --- a/src/Api/PubnubApi/Pubnub.cs +++ b/src/Api/PubnubApi/Pubnub.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Globalization; using System.Reflection; +using PubnubApi.EndPoint; #if !NET35 && !NET40 using System.Collections.Concurrent; #endif @@ -18,6 +19,10 @@ public class Pubnub private readonly EndPoint.TokenManager tokenManager; private object savedSubscribeOperation; private readonly string savedSdkVerion; + + #if UNITY + private static System.Func> OnCleanupCall; + #endif static Pubnub() { @@ -30,6 +35,16 @@ static Pubnub() #endif Version = string.Format(CultureInfo.InvariantCulture, "{0}CSharp{1}", PNPlatform.Get(), assemblyVersion); } + + #if UNITY + /// + /// Call this function to globally clean up all background threads running in the SDK. Note that this will unsubscribe all channels. + /// + public static void CleanUp() + { + OnCleanupCall?.Invoke(); + } + #endif #region "PubNub API Channel Methods" @@ -860,6 +875,10 @@ public void SetJsonPluggableLibrary(IJsonPluggableLibrary customJson) public Pubnub(PNConfiguration config) { + #if UNITY + OnCleanupCall += this.UnsubscribeAll; + #endif + savedSdkVerion = Version; InstanceId = Guid.NewGuid().ToString(); pubnubConfig.AddOrUpdate(InstanceId, config, (k, o) => config); @@ -905,6 +924,13 @@ public Pubnub(PNConfiguration config) } + #if UNITY + ~Pubnub() + { + OnCleanupCall -= this.UnsubscribeAll; + } + #endif + private void CheckRequiredConfigValues() { if (pubnubConfig != null && pubnubConfig.ContainsKey(InstanceId)) @@ -932,5 +958,5 @@ private void CheckRequiredConfigValues() } #endregion - } + } } \ No newline at end of file diff --git a/src/Api/PubnubApiUnity/PubnubApiUnity.csproj b/src/Api/PubnubApiUnity/PubnubApiUnity.csproj new file mode 100644 index 000000000..938408f3a --- /dev/null +++ b/src/Api/PubnubApiUnity/PubnubApiUnity.csproj @@ -0,0 +1,933 @@ + + + + netstandard1.0;netstandard1.3;netstandard1.4;netstandard1.1;netstandard2.0;net6.0 + true + True + pubnub.snk + False + False + PubNub C# .NET - Web Data Push API + PubnubApiUnity + true + + + + PubnubApiUnity + 6.18.0.0 + PubNub C# .NET - Web Data Push API + Pandu Masabathula + PubNub + LICENSE.txt + http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png + true + https://github.com/pubnub/c-sharp/ + Allow name param as optional in SetChannelMetadata. Removed default empty value. + Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing + + PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously + PubNub 2012-2021 + + $(PackageTargetFallback);dnxcore50 + + + $(PackageTargetFallback);dnxcore50 + + + $(PackageTargetFallback);dnxcore50 + + + $(PackageTargetFallback);dnxcore50 + + + False + false + + + + + + Builder\ResponseBuilder.cs + + + Builder\StatusBuilder.cs + + + Builder\UriUtil.cs + + + Builder\UrlRequestBuilder.cs + + + Callbacks\PNCallback.cs + + + Callbacks\SubscribeCallback.cs + + + ClientNetworkStatus.cs + + + ConcurrentDictionary.cs + + + EndPoint\Access\AuditOperation.cs + + + EndPoint\Access\GrantOperation.cs + + + + + EndPoint\ChannelGroup\AddChannelsToChannelGroupOperation.cs + + + EndPoint\ChannelGroup\DeleteChannelGroupOperation.cs + + + EndPoint\ChannelGroup\ListAllChannelGroupOperation.cs + + + EndPoint\ChannelGroup\ListChannelsForChannelGroupOperation.cs + + + EndPoint\ChannelGroup\RemoveChannelsFromChannelGroupOperation.cs + + + + + + + + + + + + + + + + + + + + + + + + + + EndPoint\OtherOperation.cs + + + EndPoint\Presence\GetStateOperation.cs + + + EndPoint\Presence\HereNowOperation.cs + + + EndPoint\Presence\SetStateOperation.cs + + + EndPoint\Presence\WhereNowOperation.cs + + + + + EndPoint\PubSub\FireOperation.cs + + + + EndPoint\PubSub\ListenerManager.cs + + + EndPoint\PubSub\PublishOperation.cs + + + + + EndPoint\PubSub\SubscribeManager.cs + + + EndPoint\PubSub\SubscribeOperation.cs + + + EndPoint\PubSub\UnsubscribeAllOperation.cs + + + EndPoint\PubSub\UnsubscribeOperation.cs + + + EndPoint\Push\AddPushChannelOperation.cs + + + EndPoint\Push\AuditPushChannelOperation.cs + + + + EndPoint\Push\RemovePushChannelOperation.cs + + + + + + + + EndPoint\TimeOperation.cs + + + + + + Enum\PNHeartbeatNotificationOption.cs + + + Enum\PNLogVerbosity.cs + + + + Enum\PNOperationType.cs + + + Enum\PNReconnectionPolicy.cs + + + Enum\PNStatusCategory.cs + + + Enum\PubnubErrorCode.cs + + + Enum\PubnubErrorSeverity.cs + + + Enum\PubnubMessageSource.cs + + + + Enum\PushTypeService.cs + + + Enum\ResponseType.cs + + + + HttpUtility\HttpUtility.cs + + + HttpUtility\HttpValue.cs + + + HttpUtility\HttpValueCollection.cs + + + Interface\IJsonPluggableLibrary.cs + + + Interface\IPubnubHttp.cs + + + Interface\IPubnubLog.cs + + + Interface\IPubnubUnitTest.cs + + + Interface\IUrlRequestBuilder.cs + + + + + + + + + + + + + + + + + + + + + + + + + Log\LoggingMethod.cs + + + Log\PNPlatform.cs + + + Model\Consumer\AccessManager\PNAccessManagerAuditResult.cs + + + Model\Consumer\AccessManager\PNAccessManagerGrantResult.cs + + + Model\Consumer\AccessManager\PNAccessManagerKeyData.cs + + + Model\Consumer\AccessManager\PNAccessManagerKeysData.cs + + + + + + + + Model\Consumer\ChannelGroup\PNChannelGroupsAddChannelResult.cs + + + Model\Consumer\ChannelGroup\PNChannelGroupsAllChannelsResult.cs + + + Model\Consumer\ChannelGroup\PNChannelGroupsDeleteGroupResult.cs + + + Model\Consumer\ChannelGroup\PNChannelGroupsListAllResult.cs + + + Model\Consumer\ChannelGroup\PNChannelGroupsRemoveChannelResult.cs + + + + + + + + + + + + + + + Model\Consumer\History\PNHistoryItemResult.cs + + + Model\Consumer\History\PNHistoryResult.cs + + + + + + + + + + + + + + + + + + + + + Model\Consumer\PNErrorData.cs + + + + Model\Consumer\PNStatus.cs + + + Model\Consumer\PNTimeResult.cs + + + Model\Consumer\Presence\PNGetStateResult.cs + + + Model\Consumer\Presence\PNHereNowChannelData.cs + + + Model\Consumer\Presence\PNHereNowOccupantData.cs + + + Model\Consumer\Presence\PNHereNowResult.cs + + + Model\Consumer\Presence\PNSetStateResult.cs + + + Model\Consumer\Presence\PNWhereNowResult.cs + + + + + + + + + Model\Consumer\Pubsub\PNMessageResult.cs + + + + Model\Consumer\Pubsub\PNPresenceEventResult.cs + + + Model\Consumer\Pubsub\PNPublishResult.cs + + + + + Model\Consumer\Push\PNPushAddChannelResult.cs + + + Model\Consumer\Push\PNPushListProvisionsResult.cs + + + Model\Consumer\Push\PNPushRemoveAllChannelsResult.cs + + + Model\Consumer\Push\PNPushRemoveChannelResult.cs + + + + Model\Derived\AccessManager\PNAccessManagerAuditResultExt.cs + + + Model\Derived\AccessManager\PNAccessManagerGrantResultExt.cs + + + + + Model\Derived\ChannelGroup\PNChannelGroupsAddChannelResultExt.cs + + + Model\Derived\ChannelGroup\PNChannelGroupsAllChannelsResultExt.cs + + + Model\Derived\ChannelGroup\PNChannelGroupsDeleteGroupResultExt.cs + + + Model\Derived\ChannelGroup\PNChannelGroupsListAllResultExt.cs + + + Model\Derived\ChannelGroup\PNChannelGroupsRemoveChannelResultExt.cs + + + + + + + + + + + + Model\Derived\History\PNHistoryResultExt.cs + + + + + + + + + + + + + + Model\Derived\PNTimeResultExt.cs + + + Model\Derived\Presence\PNGetStateResultExt.cs + + + Model\Derived\Presence\PNHereNowResultEx.cs + + + Model\Derived\Presence\PNSetStateResultExt.cs + + + Model\Derived\Presence\PNWhereNowResultExt.cs + + + + + Model\Derived\Pubsub\PNPublishResultExt.cs + + + + Model\Derived\Pubsub\SubscribeCallbackExt.cs + + + Model\Derived\Push\PNPushAddChannelResultExt.cs + + + Model\Derived\Push\PNPushListProvisionsResultExt.cs + + + + Model\Derived\Push\PNPushRemoveChannelResultExt.cs + + + Model\InternetState.cs + + + + Model\PNHeartbeatResult.cs + + + Model\PNStatusCategoryHelper.cs + + + + Model\ReconnectState.cs + + + Model\RequestState.cs + + + Model\Server\SubscribeEnvelope.cs + + + Model\Server\SubscribeMessage.cs + + + Model\Server\TimetokenMetadata.cs + + + NewtonsoftJsonDotNet.cs + + + PNConfiguration.cs + + + + Proxy\PubnubProxy.cs + + + Pubnub.cs + + + PubnubCoreBase.cs + + + PubnubHttp.cs + + + + Push\Mpns\MpnsCycleTileNotification.cs + + + Push\Mpns\MpnsFlipTileNotification.cs + + + Push\Mpns\MpnsIconicTileNotification.cs + + + Push\Mpns\MpnsToastNotification.cs + + + Security\MD5.cs + + + Security\MD5CryptoServiceProvider.cs + + + Security\PubnubCrypto.cs + + + Security\PubnubCryptoBase.cs + + + Security\SecureMessage.cs + + + Timer.cs + + + + + UNITY + + + + $(DefineConstants);NETSTANDARD10;UNITY + + + + $(DefineConstants);NETSTANDARD11;UNITY + + + + $(DefineConstants);NETSTANDARD13;UNITY + + + + $(DefineConstants);NETSTANDARD14;UNITY + + + + $(DefineConstants);NETSTANDARD20;UNITY + + + + $(DefineConstants);NET60;UNITY + + + + 1701;1702; + + + + 1701;1702; + + + + + + + + + + None + + + None + + + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + 4.3.0 + None + + + + + + + None + + + None + + + + + None + + + None + + + None + + + None + + + 4.3.0 + None + + + + + + + None + + + None + + + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + 4.3.0 + None + + + + + + + + + None + + + None + + + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + 4.3.0 + None + + + + + + + None + + + None + + + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + 4.3.0 + None + + + + + + + None + + + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + None + + + 4.3.0 + None + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Api/PubnubApiUnity/pubnub.snk b/src/Api/PubnubApiUnity/pubnub.snk new file mode 100644 index 000000000..ab6f98e6c Binary files /dev/null and b/src/Api/PubnubApiUnity/pubnub.snk differ diff --git a/src/Pubnub.sln b/src/Pubnub.sln index 13b6bc8a2..ee8f238b4 100644 --- a/src/Pubnub.sln +++ b/src/Pubnub.sln @@ -29,6 +29,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MockServerPubnubApiPCL", "U EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AcceptanceTests", "UnitTests\AcceptanceTests\AcceptanceTests.csproj", "{15805B6C-C474-4DD7-BD7F-150A7EA23F5C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PubnubApiUnity", "Api\PubnubApiUnity\PubnubApiUnity.csproj", "{55D8FD89-D9CF-4A11-B997-948AFF801A43}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug_Ubuntu|Any CPU = Debug_Ubuntu|Any CPU @@ -337,6 +339,38 @@ Global {15805B6C-C474-4DD7-BD7F-150A7EA23F5C}.Release|x64.Build.0 = Release|Any CPU {15805B6C-C474-4DD7-BD7F-150A7EA23F5C}.Release|x86.ActiveCfg = Release|Any CPU {15805B6C-C474-4DD7-BD7F-150A7EA23F5C}.Release|x86.Build.0 = Release|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug_Ubuntu|Any CPU.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug_Ubuntu|ARM.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug_Ubuntu|ARM.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug_Ubuntu|x64.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug_Ubuntu|x64.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug_Ubuntu|x86.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug_Ubuntu|x86.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug|ARM.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug|ARM.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug|x64.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug|x64.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug|x86.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Debug|x86.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release_Ubuntu|Any CPU.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release_Ubuntu|Any CPU.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release_Ubuntu|ARM.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release_Ubuntu|ARM.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release_Ubuntu|x64.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release_Ubuntu|x64.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release_Ubuntu|x86.ActiveCfg = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release_Ubuntu|x86.Build.0 = Debug|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release|Any CPU.Build.0 = Release|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release|ARM.ActiveCfg = Release|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release|ARM.Build.0 = Release|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release|x64.ActiveCfg = Release|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release|x64.Build.0 = Release|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release|x86.ActiveCfg = Release|Any CPU + {55D8FD89-D9CF-4A11-B997-948AFF801A43}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -351,6 +385,7 @@ Global {5ACBD3DD-B120-4F8C-91EB-D4D8F83E9F2C} = {D2051EEF-B0DA-43C4-8569-4D48FE76A5CB} {C1449A27-2C29-40FF-BAD4-521BDFD323EB} = {D2051EEF-B0DA-43C4-8569-4D48FE76A5CB} {15805B6C-C474-4DD7-BD7F-150A7EA23F5C} = {D2051EEF-B0DA-43C4-8569-4D48FE76A5CB} + {55D8FD89-D9CF-4A11-B997-948AFF801A43} = {F101EAB9-89CA-4ACB-A72B-0660F4C9CC38} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A640EAE8-CEFD-4AFB-86DE-4112005EB515}