diff --git a/.pubnub.yml b/.pubnub.yml index aea02a8..753356f 100644 --- a/.pubnub.yml +++ b/.pubnub.yml @@ -1,6 +1,11 @@ --- -version: v0.4.3 +version: v0.4.4 changelog: + - date: 2025-05-12 + version: v0.4.4 + changes: + - type: feature + text: "Added the ChatMembershipData which replaces the customDataJson argument in membership-related methods." - date: 2025-04-02 version: v0.4.3 changes: diff --git a/c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/MembershipTests.cs b/c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/MembershipTests.cs index f3bc513..958a0e9 100644 --- a/c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/MembershipTests.cs +++ b/c-sharp-chat/PubnubChatApi/PubNubChatApi.Tests/MembershipTests.cs @@ -56,17 +56,24 @@ public async Task TestUpdateMemberships() return; } + var updateData = new ChatMembershipData() + { + CustomDataJson = "{\"key\":\"" + Guid.NewGuid() + "\"}" + }; + var manualUpdatedEvent = new ManualResetEvent(false); testMembership.OnMembershipUpdated += membership => { Assert.True(membership.Id == testMembership.Id); + var updatedData = membership.MembershipData.CustomDataJson; + Assert.True(updatedData == updateData.CustomDataJson, $"{updatedData} != {updateData.CustomDataJson}"); manualUpdatedEvent.Set(); }; testMembership.SetListeningForUpdates(true); await Task.Delay(4000); - await testMembership.Update("{\"key\": \"" + Guid.NewGuid() + "\"}"); + await testMembership.Update(updateData); var updated = manualUpdatedEvent.WaitOne(8000); Assert.IsTrue(updated); } diff --git a/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Channel.cs b/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Channel.cs index 04f688f..117162d 100644 --- a/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Channel.cs +++ b/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Channel.cs @@ -152,7 +152,7 @@ private static extern int pn_channel_get_users_restrictions(IntPtr channel, stri [DllImport("pubnub-chat")] private static extern IntPtr pn_channel_stream_message_reports(IntPtr channel); - + [DllImport("pubnub-chat")] private static extern IntPtr pn_channel_stream_updates(IntPtr channel); @@ -162,6 +162,14 @@ private static extern int pn_channel_get_users_restrictions(IntPtr channel, stri [DllImport("pubnub-chat")] private static extern IntPtr pn_channel_stream_presence(IntPtr channel); + [DllImport("pubnub-chat")] + private static extern IntPtr pn_channel_join_with_membership_data( + IntPtr channel, + string membership_custom_json, + string membership_type, + string membership_status + ); + #endregion /// @@ -367,7 +375,7 @@ public async void SetListeningForReportEvents(bool listen) reportEventsListeningHandle = await SetListening(reportEventsListeningHandle, listen, () => pn_channel_stream_message_reports(pointer)); } - + internal void BroadcastReportEvent(ChatEvent chatEvent) { OnReportEvent?.Invoke(chatEvent); @@ -378,13 +386,13 @@ public async void SetListeningForReadReceiptsEvents(bool listen) readReceiptsListeningHandle = await SetListening(readReceiptsListeningHandle, listen, () => pn_channel_stream_read_receipts(pointer)); } - + public async void SetListeningForTyping(bool listen) { typingListeningHandle = await SetListening(typingListeningHandle, listen, () => pn_channel_get_typing(pointer)); } - + public async void SetListeningForPresence(bool listen) { presenceListeningHandle = await SetListening(presenceListeningHandle, listen, @@ -437,7 +445,8 @@ internal void TryParseAndBroadcastTypingEvent(List userIds) { indicator.Stop(); typingIndicators.Remove(key); - indicator.Dispose();; + indicator.Dispose(); + ; } } @@ -600,10 +609,10 @@ public async void Connect() { return; } + connectionHandle = await SetListening(connectionHandle, true, () => pn_channel_connect(pointer)); } - // TODO: Shouldn't join have additional parameters? /// /// Joins the channel. /// @@ -626,13 +635,24 @@ public async void Connect() /// /// /// - public async void Join() + public async void Join(ChatMembershipData? membershipData = null) { if (connectionHandle != IntPtr.Zero) { return; } - connectionHandle = await SetListening(connectionHandle, true, () => pn_channel_join(pointer, string.Empty)); + + if (membershipData == null) + { + connectionHandle = + await SetListening(connectionHandle, true, () => pn_channel_join(pointer, string.Empty)); + } + else + { + connectionHandle = await SetListening(connectionHandle, true, + () => pn_channel_join_with_membership_data(pointer, membershipData.CustomDataJson, + membershipData.Type, membershipData.Status)); + } } /// @@ -659,6 +679,7 @@ public void Disconnect() { return; } + CUtilities.CheckCFunctionResult(pn_channel_disconnect(pointer)); pn_callback_handle_dispose(connectionHandle); connectionHandle = IntPtr.Zero; @@ -690,6 +711,7 @@ public async void Leave() { return; } + var connectionHandleCopy = connectionHandle; connectionHandle = IntPtr.Zero; CUtilities.CheckCFunctionResult(await Task.Run(() => @@ -698,6 +720,7 @@ public async void Leave() { return 0; } + pn_channel_leave(pointer); pn_callback_handle_dispose(connectionHandleCopy); return 0; diff --git a/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Chat.cs b/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Chat.cs index 07d9903..c29fb36 100644 --- a/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Chat.cs +++ b/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Chat.cs @@ -267,6 +267,41 @@ private static extern int pn_chat_get_user_suggestions(IntPtr chat, string text, private static extern int pn_chat_get_current_user_mentions(IntPtr chat, string start_timetoken, string end_timetoken, int count, StringBuilder result); + [DllImport("pubnub-chat")] + private static extern IntPtr + pn_chat_create_direct_conversation_dirty_with_membership_data( + IntPtr chat, + IntPtr user, + string channel_id, + string channel_name, + string channel_description, + string channel_custom_data_json, + string channel_updated, + string channel_status, + string channel_type, + string membership_custom_json, + string membership_type, + string membership_status + ); + + [DllImport("pubnub-chat")] + private static extern IntPtr + pn_chat_create_group_conversation_dirty_with_membership_data( + IntPtr chat, + IntPtr[] users, + int users_length, + string channel_id, + string channel_name, + string channel_description, + string channel_custom_data_json, + string channel_updated, + string channel_status, + string channel_type, + string membership_custom_json, + string membership_type, + string membership_status + ); + #endregion private IntPtr chatPointer; @@ -276,7 +311,7 @@ private static extern int pn_chat_get_current_user_mentions(IntPtr chat, string private Dictionary membershipWrappers = new(); private Dictionary messageWrappers = new(); private bool fetchUpdates = true; - + public event Action OnAnyEvent; public ChatAccessManager ChatAccessManager { get; } @@ -326,6 +361,7 @@ internal async Task FetchUpdatesLoop() { Debug.WriteLine($"Error when parsing JSON updates: {e}"); } + await Task.Delay(200); } } @@ -336,11 +372,11 @@ internal void ParseJsonUpdatePointers(string jsonString) { return; } - + Debug.WriteLine($"Received JSON to parse: {jsonString}"); var jArray = JArray.Parse(jsonString); - + var updates = jArray .Children() .SelectMany(jo => jo.Properties()) @@ -350,7 +386,7 @@ internal void ParseJsonUpdatePointers(string jsonString) grp => grp.SelectMany(jp => jp.Value is JArray ? jp.Value.Values() : new[] { jp.Value.ToString() }).ToList() ); - + foreach (var update in updates) { foreach (var json in update.Value) @@ -359,27 +395,29 @@ internal void ParseJsonUpdatePointers(string jsonString) { continue; } - + Debug.WriteLine($"Parsing JSON:\n--Key: {update.Key},\n--Value: {json}"); - + switch (update.Key) { // {"channel_id": "", "data" : [{"": ["", ""]}]} case "read_receipts": var jObject = JObject.Parse(json); - if (!jObject.TryGetValue("channel_id", out var readChannelId) + if (!jObject.TryGetValue("channel_id", out var readChannelId) || !jObject.TryGetValue("data", out var data)) { Debug.WriteLine("Incorrect read recepits JSON payload!"); continue; } + if (!TryGetChannel(readChannelId.ToString(), out var readReceiptChannel)) { Debug.WriteLine("Can't find the read receipt channel!"); continue; } - var receipts = data.Children() - .SelectMany(j => j.Children()) + + var receipts = data.Children() + .SelectMany(j => j.Children()) .ToDictionary(jp => jp.Name, jp => jp.Value.ToObject>()); readReceiptChannel.BroadcastReadReceipt(receipts); OnAnyEvent?.Invoke(new ChatEvent() @@ -395,6 +433,7 @@ internal void ParseJsonUpdatePointers(string jsonString) { continue; } + foreach (var kvp in typings) { if (TryGetChannel(kvp.Key, out var typingChannel)) @@ -408,6 +447,7 @@ internal void ParseJsonUpdatePointers(string jsonString) }); } } + break; case "event": case "message_report": @@ -434,6 +474,7 @@ internal void ParseJsonUpdatePointers(string jsonString) reportChannel.BroadcastReportEvent(chatEvent); invoked = true; } + break; case PubnubChatEventType.Mention: if (TryGetUser(chatEvent.UserId, out var mentionedUser)) @@ -441,6 +482,7 @@ internal void ParseJsonUpdatePointers(string jsonString) mentionedUser.BroadcastMentionEvent(chatEvent); invoked = true; } + break; case PubnubChatEventType.Invite: if (TryGetUser(chatEvent.UserId, out var invitedUser)) @@ -448,6 +490,7 @@ internal void ParseJsonUpdatePointers(string jsonString) invitedUser.BroadcastInviteEvent(chatEvent); invoked = true; } + break; case PubnubChatEventType.Custom: if (TryGetChannel(chatEvent.ChannelId, out var customEventChannel)) @@ -455,6 +498,7 @@ internal void ParseJsonUpdatePointers(string jsonString) customEventChannel.BroadcastCustomEvent(chatEvent); invoked = true; } + break; case PubnubChatEventType.Moderation: if (TryGetUser(chatEvent.UserId, out var moderatedUser)) @@ -462,6 +506,7 @@ internal void ParseJsonUpdatePointers(string jsonString) moderatedUser.BroadcastModerationEvent(chatEvent); invoked = true; } + break; default: throw new ArgumentOutOfRangeException(); @@ -471,6 +516,7 @@ internal void ParseJsonUpdatePointers(string jsonString) { OnAnyEvent?.Invoke(chatEvent); } + break; case "message": var messagePointer = JsonConvert.DeserializeObject(json); @@ -489,9 +535,11 @@ internal void ParseJsonUpdatePointers(string jsonString) { messageWrappers[timeToken] = message; } + channel.BroadcastMessageReceived(message); } } + break; case "thread_message_update": var updatedThreadMessagePointer = JsonConvert.DeserializeObject(json); @@ -513,6 +561,7 @@ internal void ParseJsonUpdatePointers(string jsonString) } } } + break; case "message_update": var updatedMessagePointer = JsonConvert.DeserializeObject(json); @@ -526,6 +575,7 @@ internal void ParseJsonUpdatePointers(string jsonString) existingMessageWrapper.BroadcastMessageUpdate(); } } + break; case "channel_update": var channelPointer = JsonConvert.DeserializeObject(json); @@ -549,6 +599,7 @@ internal void ParseJsonUpdatePointers(string jsonString) existingChannelWrapper.BroadcastChannelUpdate(); } } + break; case "user_update": var userPointer = JsonConvert.DeserializeObject(json); @@ -563,6 +614,7 @@ internal void ParseJsonUpdatePointers(string jsonString) existingUserWrapper.BroadcastUserUpdate(); } } + break; case "membership_update": var membershipPointer = JsonConvert.DeserializeObject(json); @@ -577,6 +629,7 @@ internal void ParseJsonUpdatePointers(string jsonString) existingMembershipWrapper.BroadcastMembershipUpdate(); } } + break; case "presence_users": Debug.WriteLine("Deserialized presence update"); @@ -586,6 +639,7 @@ internal void ParseJsonUpdatePointers(string jsonString) { break; } + foreach (var pair in presenceDictionary) { var channelId = pair.Key; @@ -594,11 +648,13 @@ internal void ParseJsonUpdatePointers(string jsonString) channelId = channelId.Substring(0, channelId.LastIndexOf("-pnpres", StringComparison.Ordinal)); } + if (TryGetChannel(channelId, out var channel)) { channel.BroadcastPresenceUpdate(); } } + break; default: Debug.WriteLine("Wasn't able to deserialize incoming pointer into any known type!"); @@ -655,6 +711,7 @@ public async Task CreatePublicConversation(string channelId = "") { channelId = Guid.NewGuid().ToString(); } + return await CreatePublicConversation(channelId, new ChatChannelData()); } @@ -700,23 +757,37 @@ public async Task CreatePublicConversation(string channelId, ChatChanne return channel; } - public async Task CreateDirectConversation(User user, string channelId = "") + public async Task CreateDirectConversation(User user, string channelId = "", + ChatChannelData? channelData = null, ChatMembershipData? membershipData = null) { if (string.IsNullOrEmpty(channelId)) { channelId = Guid.NewGuid().ToString(); } - return await CreateDirectConversation(user, channelId, new ChatChannelData()); - } - public async Task CreateDirectConversation(User user, string channelId, - ChatChannelData channelData) - { - var wrapperPointer = await Task.Run(() => pn_chat_create_direct_conversation_dirty(chatPointer, - user.Pointer, channelId, - channelData.ChannelName, - channelData.ChannelDescription, channelData.ChannelCustomDataJson, channelData.ChannelUpdated, - channelData.ChannelStatus, channelData.ChannelType)); + channelData ??= new ChatChannelData(); + + IntPtr wrapperPointer; + + if (membershipData == null) + { + wrapperPointer = await Task.Run(() => pn_chat_create_direct_conversation_dirty(chatPointer, + user.Pointer, channelId, + channelData.ChannelName, + channelData.ChannelDescription, channelData.ChannelCustomDataJson, channelData.ChannelUpdated, + channelData.ChannelStatus, channelData.ChannelType)); + } + else + { + wrapperPointer = await Task.Run(() => pn_chat_create_direct_conversation_dirty_with_membership_data( + chatPointer, + user.Pointer, channelId, + channelData.ChannelName, + channelData.ChannelDescription, channelData.ChannelCustomDataJson, channelData.ChannelUpdated, + channelData.ChannelStatus, channelData.ChannelType, membershipData.CustomDataJson, + membershipData.Type, membershipData.Status)); + } + CUtilities.CheckCFunctionResult(wrapperPointer); var createdChannelPointer = pn_chat_get_created_channel_wrapper_channel(wrapperPointer); @@ -742,22 +813,33 @@ public async Task CreateDirectConversation(User user, str }; } - public async Task CreateGroupConversation(List users, string channelId = "") + public async Task CreateGroupConversation(List users, string channelId = "", + ChatChannelData? channelData = null, ChatMembershipData? membershipData = null) { if (string.IsNullOrEmpty(channelId)) { channelId = Guid.NewGuid().ToString(); } - return await CreateGroupConversation(users, channelId, new ChatChannelData()); - } + channelData ??= new ChatChannelData(); + + IntPtr wrapperPointer; + if (membershipData == null) + { + wrapperPointer = await Task.Run(() => pn_chat_create_group_conversation_dirty(chatPointer, + users.Select(x => x.Pointer).ToArray(), users.Count, channelId, channelData.ChannelName, + channelData.ChannelDescription, channelData.ChannelCustomDataJson, channelData.ChannelUpdated, + channelData.ChannelStatus, channelData.ChannelType)); + } + else + { + wrapperPointer = await Task.Run(() => pn_chat_create_group_conversation_dirty_with_membership_data( + chatPointer, + users.Select(x => x.Pointer).ToArray(), users.Count, channelId, channelData.ChannelName, + channelData.ChannelDescription, channelData.ChannelCustomDataJson, channelData.ChannelUpdated, + channelData.ChannelStatus, channelData.ChannelType, membershipData.CustomDataJson, + membershipData.Type, membershipData.Status)); + } - public async Task CreateGroupConversation(List users, string channelId, - ChatChannelData channelData) - { - var wrapperPointer = await Task.Run(() => pn_chat_create_group_conversation_dirty(chatPointer, - users.Select(x => x.Pointer).ToArray(), users.Count, channelId, channelData.ChannelName, - channelData.ChannelDescription, channelData.ChannelCustomDataJson, channelData.ChannelUpdated, - channelData.ChannelStatus, channelData.ChannelType)); CUtilities.CheckCFunctionResult(wrapperPointer); var createdChannelPointer = pn_chat_get_created_channel_wrapper_channel(wrapperPointer); @@ -1808,7 +1890,7 @@ public async Task EmitEvent(PubnubChatEventType type, string channelId, string j CUtilities.CheckCFunctionResult(await Task.Run(() => pn_chat_emit_event(chatPointer, (byte)type, channelId, jsonPayload))); } - + internal IntPtr ListenForEvents(string channelId, PubnubChatEventType type) { if (string.IsNullOrEmpty(channelId)) diff --git a/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Data/ChatMembershipData.cs b/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Data/ChatMembershipData.cs new file mode 100644 index 0000000..a0f47f4 --- /dev/null +++ b/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Data/ChatMembershipData.cs @@ -0,0 +1,18 @@ +namespace PubnubChatApi.Entities.Data +{ + /// + /// Data class for a chat membership. + /// + /// Contains all the additional data related to the chat membership. + /// + /// + /// + /// By default, all the properties are set to empty strings. + /// + public class ChatMembershipData + { + public string CustomDataJson { get; set; } = string.Empty; + public string Status { get; set; } = string.Empty; + public string Type { get; set; } = string.Empty; + } +} \ No newline at end of file diff --git a/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Membership.cs b/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Membership.cs index 356d3b0..48184cb 100644 --- a/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Membership.cs +++ b/c-sharp-chat/PubnubChatApi/PubnubChatApi/Entities/Membership.cs @@ -2,6 +2,8 @@ using System.Runtime.InteropServices; using System.Text; using System.Threading.Tasks; +using Newtonsoft.Json; +using PubnubChatApi.Entities.Data; using PubnubChatApi.Enums; using PubnubChatApi.Utilities; @@ -40,7 +42,9 @@ private static extern void pn_membership_get_channel_id( [DllImport("pubnub-chat")] private static extern IntPtr pn_membership_update_dirty( IntPtr membership, - string custom_object_json); + string custom_data_json, + string type, + string status); [DllImport("pubnub-chat")] private static extern int pn_membership_last_read_message_timetoken(IntPtr membership, StringBuilder result); @@ -57,10 +61,15 @@ private static extern IntPtr pn_membership_update_dirty( [DllImport("pubnub-chat")] private static extern IntPtr pn_membership_update_with_base(IntPtr membership, IntPtr base_membership); - + [DllImport("pubnub-chat")] private static extern IntPtr pn_membership_stream_updates(IntPtr membership); + [DllImport("pubnub-chat")] + private static extern void pn_membership_get_membership_data( + IntPtr membership, + StringBuilder result); + #endregion /// @@ -89,6 +98,26 @@ public string ChannelId } } + /// + /// Returns a class with additional Membership data. + /// + public ChatMembershipData MembershipData + { + get + { + var buffer = new StringBuilder(512); + pn_membership_get_membership_data(pointer, buffer); + var jsonString = buffer.ToString(); + var data = new ChatMembershipData(); + if (CUtilities.IsValidJson(jsonString)) + { + data = JsonConvert.DeserializeObject(jsonString); + } + + return data; + } + } + /// /// Event that is triggered when the membership is updated. /// @@ -109,7 +138,8 @@ public string ChannelId private Chat chat; - internal Membership(Chat chat, IntPtr membershipPointer, string membershipId) : base(membershipPointer, membershipId) + internal Membership(Chat chat, IntPtr membershipPointer, string membershipId) : base(membershipPointer, + membershipId) { this.chat = chat; } @@ -134,7 +164,7 @@ internal void BroadcastMembershipUpdate() { OnMembershipUpdated?.Invoke(this); } - + internal override void UpdateWithPartialPtr(IntPtr partialPointer) { var newFullPointer = pn_membership_update_with_base(partialPointer, pointer); @@ -143,22 +173,18 @@ internal override void UpdateWithPartialPtr(IntPtr partialPointer) } /// - /// Updates the membership with a custom JSON object. + /// Updates the membership with a ChatMembershipData object. /// - /// This method updates the membership with a custom JSON object. This object can be used to store + /// This method updates the membership with a ChatMembershipData object. This object can be used to store /// additional information about the membership. /// /// - /// The custom JSON object to update the membership with. - /// - /// - /// membership.Update("{\"key\": \"value\"}"); - /// - /// + /// The ChatMembershipData object to update the membership with. /// - public async Task Update(string customJsonObject) + public async Task Update(ChatMembershipData membershipData) { - var newPointer = await Task.Run(() => pn_membership_update_dirty(pointer, customJsonObject)); + var newPointer = await Task.Run(() => pn_membership_update_dirty(pointer, membershipData.CustomDataJson, + membershipData.Type, membershipData.Status)); CUtilities.CheckCFunctionResult(newPointer); UpdatePointer(newPointer); } @@ -176,7 +202,7 @@ public async Task SetLastReadMessage(Message message) CUtilities.CheckCFunctionResult(newPointer); UpdatePointer(newPointer); } - + public async Task SetLastReadMessageTimeToken(string timeToken) { var newPointer = await Task.Run(() => pn_membership_set_last_read_message_timetoken(pointer, timeToken)); diff --git a/c-sharp-chat/PubnubChatApi/PubnubChatApi/pubnub-chat.dll b/c-sharp-chat/PubnubChatApi/PubnubChatApi/pubnub-chat.dll index 76b0b2d..6e6a3d3 100644 Binary files a/c-sharp-chat/PubnubChatApi/PubnubChatApi/pubnub-chat.dll and b/c-sharp-chat/PubnubChatApi/PubnubChatApi/pubnub-chat.dll differ diff --git a/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.dll b/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.dll index d78f28e..fc957d2 100644 Binary files a/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.dll and b/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.dll differ diff --git a/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.xml b/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.xml index 16f9181..1354345 100644 --- a/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.xml +++ b/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/PubnubChatApi.xml @@ -164,9 +164,9 @@ Thrown when an error occurs while connecting to the channel. - + - + Joins the channel. @@ -208,7 +208,7 @@ Thrown when an error occurs while disconnecting from the channel. - + @@ -228,7 +228,7 @@ Thrown when an error occurs while leaving the channel. - + @@ -970,6 +970,11 @@ The channel ID of the channel that this membership belongs to. + + + Returns a class with additional Membership data. + + Event that is triggered when the membership is updated. @@ -986,22 +991,17 @@ }; - + - + - Updates the membership with a custom JSON object. + Updates the membership with a ChatMembershipData object. - This method updates the membership with a custom JSON object. This object can be used to store + This method updates the membership with a ChatMembershipData object. This object can be used to store additional information about the membership. - The custom JSON object to update the membership with. - - - membership.Update("{\"key\": \"value\"}"); - - + The ChatMembershipData object to update the membership with. @@ -1535,6 +1535,17 @@ By default, all the properties are set to empty strings. + + + Data class for a chat membership. + + Contains all the additional data related to the chat membership. + + + + By default, all the properties are set to empty strings. + + Data class for the chat user. diff --git a/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/libpubnub-chat.dylib b/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/libpubnub-chat.dylib index c82c451..321176f 100644 Binary files a/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/libpubnub-chat.dylib and b/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/libpubnub-chat.dylib differ diff --git a/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/pubnub-chat.dll b/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/pubnub-chat.dll index 76b0b2d..6e6a3d3 100644 Binary files a/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/pubnub-chat.dll and b/unity-chat/PubnubChatUnity/Assets/PubnubChat/Runtime/pubnub-chat.dll differ diff --git a/unity-chat/PubnubChatUnity/Assets/PubnubChat/package.json b/unity-chat/PubnubChatUnity/Assets/PubnubChat/package.json index cb1cb83..abfc916 100644 --- a/unity-chat/PubnubChatUnity/Assets/PubnubChat/package.json +++ b/unity-chat/PubnubChatUnity/Assets/PubnubChat/package.json @@ -1,6 +1,6 @@ { "name": "com.pubnub.pubnubchat", - "version": "0.4.3", + "version": "0.4.4", "displayName": "Pubnub Chat", "description": "PubNub Unity Chat SDK", "unity": "2022.3",