Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-add platform specific PNSDK values #112

Merged
merged 6 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/release/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,11 @@
"clearedPrefix": true,
"clearedSuffix": false
}
],
"PubNubUnity/Assets/PubNub/Runtime/Util/UnityPNSDKSource.cs": [
{
"pattern": "^\\s{2,}private const string build = \"(v?(\\.?\\d+){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\";",
"cleared": true
}
]
}
Binary file modified PubNubUnity/Assets/PubNub/Runtime/Plugins/PubnubApiUnity.dll
Binary file not shown.
11 changes: 6 additions & 5 deletions PubNubUnity/Assets/PubNub/Runtime/Util/PNManagerBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ namespace PubnubApi.Unity {
public class PNManagerBehaviour : MonoBehaviour {
public PNConfigAsset pnConfiguration;

public Pubnub pubnub {
get;
protected set;
}
public Pubnub pubnub { get; protected set; }

public SubscribeCallbackListener listener { get; }
= new SubscribeCallbackListener();
Expand Down Expand Up @@ -40,7 +37,11 @@ public Pubnub Initialize(string userId) {
if (pnConfiguration.LogToUnityConsole) {
pnConfig.PubnubLog = new UnityPNLog();
}
pubnub = pnConfiguration.EnableWebGLBuildMode ? new Pubnub(pnConfig, new UnityWebGLHttpClientService()) : new Pubnub(pnConfig);

pubnub = pnConfiguration.EnableWebGLBuildMode
? new Pubnub(pnConfig, httpTransportService: new UnityWebGLHttpClientService(),
ipnsdkSource: new UnityPNSDKSource())
: new Pubnub(pnConfig, ipnsdkSource: new UnityPNSDKSource());
pubnub.SetJsonPluggableLibrary(new NewtonsoftJsonUnity(pnConfig, pnConfig.PubnubLog));
pubnub.AddListener(listener);
return pubnub;
Expand Down
30 changes: 30 additions & 0 deletions PubNubUnity/Assets/PubNub/Runtime/Util/UnityPNSDKSource.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using System;
using PubnubApi.PNSDK;

namespace PubnubApi.Unity
{
public class UnityPNSDKSource : IPNSDKSource {

private const string build = "v8.0.0";

public string GetPNSDK() {
#if(UNITY_IOS)
return string.Format("PubNub-CSharp-UnityIOS/{0}", build);
#elif(UNITY_STANDALONE_WIN)
return string.Format("PubNub-CSharp-UnityWin/{0}", build);
#elif(UNITY_STANDALONE_OSX)
return string.Format("PubNub-CSharp-UnityOSX/{0}", build);
#elif(UNITY_ANDROID)
return string.Format("PubNub-CSharp-UnityAndroid/{0}", build);
#elif(UNITY_STANDALONE_LINUX)
return string.Format("PubNub-CSharp-UnityLinux/{0}", build);
#elif(UNITY_WEBPLAYER)
return string.Format("PubNub-CSharp-UnityWeb/{0}", build);
#elif(UNITY_WEBGL)
return string.Format("PubNub-CSharp-UnityWebGL/{0}", build);
#else
return string.Format("PubNub-CSharp-Unity/{0}", build);
#endif
}
}
}
11 changes: 11 additions & 0 deletions PubNubUnity/Assets/PubNub/Runtime/Util/UnityPNSDKSource.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion PubNubUnity/Packages/packages-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "42a65698c4186c03237629f42ba3e8d9d034fe4a"
"hash": "6f074eb4c312c7201100747bddba93ebbf844beb"
},
"com.unity.collab-proxy": {
"version": "1.17.1",
Expand Down
Loading