Skip to content

Commit de8d7df

Browse files
Re-add platform specific PNSDK values (#112)
* Fix an issue where the PNSDK value would point to C# SDK instead of Unity --------- Co-authored-by: PubNub Release Bot <[email protected]>
1 parent 43d2b4e commit de8d7df

File tree

8 files changed

+58
-11
lines changed

8 files changed

+58
-11
lines changed

.pubnub.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
---
2-
version: v8.0.0
2+
version: v8.0.1
33
changelog:
4+
- date: 2025-01-20
5+
version: v8.0.1
6+
changes:
7+
- type: bug
8+
text: "Fix an issue where the PNSDK value would point to C# SDK instead of Unity."
49
- date: 2024-12-05
510
version: v8.0.0
611
changes:
@@ -743,7 +748,7 @@ sdks:
743748
distribution-type: package
744749
distribution-repository: git release
745750
package-name: PubNub.unitypackage
746-
location: https://github.com/pubnub/unity/releases/download/v8.0.0/PubNub.unitypackage
751+
location: https://github.com/pubnub/unity/releases/download/v8.0.1/PubNub.unitypackage
747752
requires:
748753
-
749754
name: "UnityEditor"
@@ -910,7 +915,7 @@ sdks:
910915
distribution-type: package
911916
distribution-repository: git release
912917
package-name: PubNub.unitypackage
913-
location: https://github.com/pubnub/unity/releases/download/v8.0.0/PubNub.unitypackage
918+
location: https://github.com/pubnub/unity/releases/download/v8.0.1/PubNub.unitypackage
914919
requires:
915920
-
916921
name: "UnityEditor"
Binary file not shown.

PubNubUnity/Assets/PubNub/Runtime/Util/PNManagerBehaviour.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@ namespace PubnubApi.Unity {
77
public class PNManagerBehaviour : MonoBehaviour {
88
public PNConfigAsset pnConfiguration;
99

10-
public Pubnub pubnub {
11-
get;
12-
protected set;
13-
}
10+
public Pubnub pubnub { get; protected set; }
1411

1512
public SubscribeCallbackListener listener { get; }
1613
= new SubscribeCallbackListener();
@@ -40,7 +37,11 @@ public Pubnub Initialize(string userId) {
4037
if (pnConfiguration.LogToUnityConsole) {
4138
pnConfig.PubnubLog = new UnityPNLog();
4239
}
43-
pubnub = pnConfiguration.EnableWebGLBuildMode ? new Pubnub(pnConfig, new UnityWebGLHttpClientService()) : new Pubnub(pnConfig);
40+
41+
pubnub = pnConfiguration.EnableWebGLBuildMode
42+
? new Pubnub(pnConfig, httpTransportService: new UnityWebGLHttpClientService(),
43+
ipnsdkSource: new UnityPNSDKSource())
44+
: new Pubnub(pnConfig, ipnsdkSource: new UnityPNSDKSource());
4445
pubnub.SetJsonPluggableLibrary(new NewtonsoftJsonUnity(pnConfig, pnConfig.PubnubLog));
4546
pubnub.AddListener(listener);
4647
return pubnub;
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using PubnubApi.PNSDK;
3+
4+
namespace PubnubApi.Unity
5+
{
6+
public class UnityPNSDKSource : IPNSDKSource {
7+
8+
private const string build = "8.0.1";
9+
10+
public string GetPNSDK() {
11+
#if(UNITY_IOS)
12+
return string.Format("PubNub-CSharp-UnityIOS/{0}", build);
13+
#elif(UNITY_STANDALONE_WIN)
14+
return string.Format("PubNub-CSharp-UnityWin/{0}", build);
15+
#elif(UNITY_STANDALONE_OSX)
16+
return string.Format("PubNub-CSharp-UnityOSX/{0}", build);
17+
#elif(UNITY_ANDROID)
18+
return string.Format("PubNub-CSharp-UnityAndroid/{0}", build);
19+
#elif(UNITY_STANDALONE_LINUX)
20+
return string.Format("PubNub-CSharp-UnityLinux/{0}", build);
21+
#elif(UNITY_WEBPLAYER)
22+
return string.Format("PubNub-CSharp-UnityWeb/{0}", build);
23+
#elif(UNITY_WEBGL)
24+
return string.Format("PubNub-CSharp-UnityWebGL/{0}", build);
25+
#else
26+
return string.Format("PubNub-CSharp-Unity/{0}", build);
27+
#endif
28+
}
29+
}
30+
}

PubNubUnity/Assets/PubNub/Runtime/Util/UnityPNSDKSource.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PubNubUnity/Assets/PubNub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "com.pubnub.sdk",
3-
"version": "8.0.0",
3+
"version": "8.0.1",
44
"displayName": "PubNub SDK",
55
"description": "PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks",
66
"unity": "2021.3",

PubNubUnity/Packages/packages-lock.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"depth": 0,
3636
"source": "git",
3737
"dependencies": {},
38-
"hash": "42a65698c4186c03237629f42ba3e8d9d034fe4a"
38+
"hash": "6f074eb4c312c7201100747bddba93ebbf844beb"
3939
},
4040
"com.unity.collab-proxy": {
4141
"version": "1.17.1",

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.0.0
1+
8.0.1

0 commit comments

Comments
 (0)