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

feat:Update PubNubUnityApi with event engine. #103

Merged
merged 4 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 10 additions & 3 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
---
version: v7.1.4
version: v7.2.0
changelog:
- date: 2024-04-18
version: v7.2.0
changes:
- type: feature
text: "Added event engine implementation for subscribe and presence operation."
- type: feature
text: "Added support for RetryConfiguration to configure subscribe request retry."
- date: 2024-04-02
version: v7.1.4
changes:
Expand Down Expand Up @@ -714,7 +721,7 @@ sdks:
distribution-type: package
distribution-repository: git release
package-name: PubNub.unitypackage
location: https://github.com/pubnub/unity/releases/download/v7.1.4/PubNub.unitypackage
location: https://github.com/pubnub/unity/releases/download/v7.2.0/PubNub.unitypackage
requires:
-
name: "UnityEditor"
Expand Down Expand Up @@ -881,7 +888,7 @@ sdks:
distribution-type: package
distribution-repository: git release
package-name: PubNub.unitypackage
location: https://github.com/pubnub/unity/releases/download/v7.1.4/PubNub.unitypackage
location: https://github.com/pubnub/unity/releases/download/v7.2.0/PubNub.unitypackage
requires:
-
name: "UnityEditor"
Expand Down
8 changes: 4 additions & 4 deletions PubNubUnity/Assets/PubNub/Runtime/Adapters/PubNub.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using System;
using System.Threading.Tasks;
using PubnubApi.EndPoint;
using PubnubApi.Interface;

namespace PubnubApi.Unity {
public static class PubnubExtensions {
public static SubscribeOperation<T> Subscribe<T>(this Pubnub pn) => pn.Subscribe<T>();
public static ISubscribeOperation<T> Subscribe<T>(this Pubnub pn) => pn.Subscribe<T>();

[Obsolete("Use the generic version instead")]
public static SubscribeOperation<string> Subscribe(this Pubnub pn) => pn.Subscribe<string>();
public static ISubscribeOperation<string> Subscribe(this Pubnub pn) => pn.Subscribe<string>();

[Obsolete("Use the generic version instead")]
public static bool Reconnect(this Pubnub pn) => pn.Reconnect<string>();
Expand Down Expand Up @@ -45,10 +46,9 @@ public static UnsubscribeAllOperation<string> UnsubscribeAll(this Pubnub pn) {


// TODO create an async variant
public static UnsubscribeOperation<string> Unsubscribe(this Pubnub pn) {
public static IUnsubscribeOperation<string> Unsubscribe(this Pubnub pn) {
return pn.Unsubscribe<string>();
}


}
}
22 changes: 11 additions & 11 deletions PubNubUnity/Assets/PubNub/Runtime/Adapters/SubscribeOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@
using System.Linq;
using PubnubApi;
using PubnubApi.EndPoint;
using PubnubApi.Interface;

namespace PubnubApi.Unity {
public static class SubscribeOperationExtensions {
public static SubscribeOperation<T> Channels<T>(this SubscribeOperation<T> so, List<string> channels) =>
public static ISubscribeOperation<T> Channels<T>(this SubscribeOperation<T> so, List<string> channels) =>
so.Channels(channels.ToArray());

public static SubscribeOperation<string> Channels(this SubscribeOperation<string> so, List<string> channels) =>
public static ISubscribeOperation<string> Channels(this SubscribeOperation<string> so, List<string> channels) =>
so.Channels<string>(channels);

public static SubscribeOperation<T> ChannelGroups<T>(this SubscribeOperation<T> so, List<string> channels) =>
public static ISubscribeOperation<T> ChannelGroups<T>(this SubscribeOperation<T> so, List<string> channels) =>
so.ChannelGroups(channels.ToArray());

public static SubscribeOperation<string> ChannelGroups(this SubscribeOperation<string> so, List<string> channels) =>
public static ISubscribeOperation<string> ChannelGroups(this SubscribeOperation<string> so, List<string> channels) =>
so.ChannelGroups<string>(channels);


public static SubscribeOperation<string> QueryParam(this SubscribeOperation<string> so,
public static ISubscribeOperation<string> QueryParam(this SubscribeOperation<string> so,
Dictionary<string, string> customQueryParam) => so.QueryParam(customQueryParam.ToDictionary(kvp => kvp.Key, kvp => kvp.Value as object));

public static UnsubscribeOperation<T> ChannelGroups<T>(this UnsubscribeOperation<T> op, List<string> channelGroups) {
return op.ChannelGroups(channelGroups.ToArray());
}
public static IUnsubscribeOperation<T> ChannelGroups<T>(this UnsubscribeOperation<T> op, List<string> channelGroups) =>
op.ChannelGroups(channelGroups.ToArray());


public static UnsubscribeOperation<T> Channels<T>(this UnsubscribeOperation<T> op, List<string> channels) {
return op.ChannelGroups(channels.ToArray());
}
public static IUnsubscribeOperation<T> Channels<T>(this UnsubscribeOperation<T> op, List<string> channels) =>
op.Channels(channels.ToArray());
}
}
Binary file not shown.
2 changes: 1 addition & 1 deletion PubNubUnity/Assets/PubNub/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "com.pubnub.sdk",
"version": "7.1.4",
"version": "7.2.0",
"displayName": "PubNub SDK",
"description": "PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks",
"unity": "2021.3",
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.4
7.2.0
Loading