Logo

dev-resources.site

for different kinds of informations.

Documentation Release Notes - December 2024

Published at
1/10/2025
Categories
pubnub
documentation
releases
releasenotes
Author
pubnubdevrel
Author
12 person written this
pubnubdevrel
open
Documentation Release Notes - December 2024

This article was originally published at https://www.pubnub.com/docs/release-notes/2024/december

December might be a quiet time for some, but not here! We’ve been busy rolling out some exciting updates and refining our documentation UX.

Here's what's new:

  • We’ve added support for custom message types across various SDKs, making it easier to work with our Publish, Subscribe, Message Persistence, and Files APIs.

  • There’s also a new membership type feature designed to help you classify user-channel relationships more easily.

  • For all the Unity developers out there, we’ve introduced support for WebGL, making sure your projects can seamlessly transition to the web.

  • The JavaScript Chat SDK has seen improvements too, with simplified message draft handling, making it easier to keep track of your conversations.

  • Our Functions offering has undergone a major transformation with the introduction of v2, bringing in versioning and several useful new modules.

  • Over in the Illuminate Dashboards, we've made it simpler to manage charts, ensuring a smoother experience all round.

  • On the documentation front, we’ve added quick links and a context switcher in the SDK docs to make it easy to navigate.

We hope these updates provide you with the necessary tools and guidance at your fingertips as you continue to build amazing things!

SDKs 📦

Custom message type (follow-up)

Type: New feature

Following the updates from last month, we have now added support for the message type parameter in Publish, Subscribe, Message Persistence, and Files APIs in the following SDKs:

  • C#
  • Unity
  • Go
  • Dart
//Publishing Dictionary
Dictionary<string, float> position = new Dictionary<string, float>();
position.Add("lat", 32F);
position.Add("lng", 32F);

Console.WriteLine("before pub: " + pubnub.JsonPluggableLibrary.SerializeToJsonString(position));

PNResult<PNPublishResult> publishResponse = await pubnub.Publish()
                                            .Message(position)
                                            .Channel("my_channel")
                                            .CustomMessageType("text-message")
                                            .ExecuteAsync();
PNPublishResult publishResult = publishResponse.Result;
PNStatus status = publishResponse.Status;
Console.WriteLine("pub timetoken: " + publishResult.Timetoken.ToString());
Enter fullscreen mode Exit fullscreen mode
//Publishing Dictionary
Dictionary<string, float> position = new Dictionary<string, float>();
position.Add("lat", 32F);
position.Add("lng", 32F);

Debug.Log("before pub: " + pubnub.JsonPluggableLibrary.SerializeToJsonString(position));

PNResult<PNPublishResult> publishResponse = await pubnub.Publish()
                                            .Message(position)
                                            .Channel("my_channel")
                                            .CustomMessageType("text-message")
                                            .ExecuteAsync();
PNPublishResult publishResult = publishResponse.Result;
PNStatus status = publishResponse.Status;
Debug.Log("pub timetoken: " + publishResult.Timetoken.ToString());
Enter fullscreen mode Exit fullscreen mode
res, status, err := pn.Publish().
    Channel("my-channel").
    Message([]string{"Hello", "there"}).
    UsePost(true).
    CustomMessageType("text-message").
    Execute()

fmt.Println(res, status, err)
Enter fullscreen mode Exit fullscreen mode
var result = await pubnub.publish('my_channel', 'hello', meta: '<json data>', customMessageType: 'text-message');
Enter fullscreen mode Exit fullscreen mode

Read Message Types for an overview of the new parameter and information on how it differs from the internal PubNub message type.

Membership type

Type: New feature

We've introduced yet another field to help you categorize memberships more easily. The membership type field lets you define a type of relationship between a user and a channel they are a member of.

For now, the following SDKs support the new field:

  • C#
  • Unity
  • Kotlin
  • Java
  • JavaScript
List<PNMembership> setMembershipChannelMetadataIdList = new List<PNMembership>();
setMembershipChannelMetadataIdList.Add(new PNMembership() 
{ 
    Channel = "my-channel", 
    Custom = new Dictionary<string, object>() { { "item", "book" } },
    Type = "admin" // Assigning the type as "admin"
});

PNResult<PNMembershipsResult> setMembershipsResponse = await pubnub.SetMemberships()
    .Uuid("my-uuid")
    .Channels(setMembershipChannelMetadataIdList)
    .Include(new PNMembershipField[] { PNMembershipField.CUSTOM, PNMembershipField.CHANNEL, PNMembershipField.CHANNEL_CUSTOM })
    .IncludeCount(true)
    .ExecuteAsync();

Enter fullscreen mode Exit fullscreen mode
List<PNMembership> setMembershipChannelMetadataIdList = new List<PNMembership>();

if (!string.IsNullOrEmpty(seMembershipChannelMetaId))
{
    setMembershipChannelMetadataIdList.Add(new PNMembership() 
    {
        Channel = "my-channel", 
        Custom = new Dictionary<string, object>() { { "item", "book" } },
        Type = "admin" // Assigning the type as "admin"
    });
}

PNResult<PNMembershipsResult> setMembershipsResponse = await pubnub.SetMemberships()
    .Uuid("my-uuid")
    .Channels(setMembershipChannelMetadataIdList)
Enter fullscreen mode Exit fullscreen mode
pubnub.setMemberships(
    channels = listOf(
        PNChannelWithCustom(
            channel = "myChannel",
            type = PatchValue(value = "admin") // Adding the type as "admin"
        )
    ),
    include = MembershipInclude(
        includeCustom = true,
        includeStatus = true,
        includeType = true,
        includeChannel = true,
        includeChannelCustom = true,
        includeChannelType = true,
        includeChannelStatus = true,
Enter fullscreen mode Exit fullscreen mode
// Define a channel membership with type
PNChannelMembership membership = PNChannelMembership.builder("myChannelId")
    .type("admin") // Setting the type as "admin"
    .build();

// Add the membership to a collection
List<PNChannelMembership> channelMemberships = new ArrayList<>();
channelMemberships.add(membership);

// Proceed with setting memberships and including desired fields
pubnub.setMemberships(channelMemberships)
    .include(MembershipInclude.builder()
        .includeTotalCount(true)
        .includeCustom(true)
        .includeChannel(true)
Enter fullscreen mode Exit fullscreen mode
// Using UUID from the config
try {
    const result = await pubnub.objects.setMemberships({
        channels: [
            { id: "ch-1", type: "admin" }, // Adding type to the channel membership
            { id: "ch-2", type: "member" }
        ],
        include: {
            typeField: true // Ensure type is included in the response
        }
    });
} catch (status) {
    console.log("operation failed w/ error:", status);
}

Enter fullscreen mode Exit fullscreen mode

WebGL in Unity SDK

Type: New feature

You can now configure your Unity project to support WebGL builds using the PubNub Unity SDK. Configuring WebGL for PubNub Unity SDK is essential because it ensures that applications using PubNub's real-time communication services can operate effectively within a web environment.

For detailed configuration steps, head to the Unity SDK docs.

Message drafts (v2) in JS Chat SDK

Type: New feature

Last month, we added support for message drafts in mobile Chat SDKs.

This month, we extended this feature to the JavaScript Chat SDK. However, this SDK had already supported the message draft feature with an implementation we decided to simplify. To align the JavaScript Chat SDK with other Chat SDKs, we decided to add support for message drafts in v2 while still supporting the previous logic as v1.

If you use the JavaScript Chat SDK and the message draft feature and would like to migrate your code or get more details, head to the docs or contact support.

Handling moderation events

Type: Improvement

We addressed feedback received on Chat SDK moderation events and decided to document how you can catch any muting/banning event types using Events & Actions.

The docs for JavaScript and Kotlin Chat SDKs have been updated to explain the whole flow, starting from the moment an event is generated to the point when it's listened to and actioned upon.

To facilitate the flow, we slightly updated the channel path to which all moderation events are sent by adding the PUBNUB_INTERNAL_MODERATION. prefix to all [user_id] channels (like, PUBNUB_INTERNAL_MODERATION.alex), letting you filter out all such channels with Events & Actions listeners.

Functions ⚙️

Functions v2

Type: New feature

One of the significant changes we introduced this month was a complete refresh of our Functions offering.

Functions v2

All new customers who start using Functions will get this revamped experience in v2:

  • Functions finally support versioning
  • Functions now operate on an account instead of a keyset level, giving you one Package of Functions deployed to multiple keysets (no need to copy and paste Functions anymore as many times as they have to be deployed)
  • Zero-downtime deployment – thanks to rolling updates, you don't have to stop your Function first to update and restart it as Functions get updated without any interruptions.
  • Public KV Store and Management APIs
  • Three new Modules (UUID, JSON Web Token, JSONPath Plus)

Those already using PubNub Functions (v1) will be gradually migrated to v2.

To read about all the differences between Functions v1 and v2, refer to the docs.

Illuminate 💡

Creating charts

Type: Improvement

Illuminate Dashboards UI has been updated to make it clear that:

  • You can now add or remove decision charts from each metric's chart on a Dashboard. Each metric's chart can have up to five Decision charts.

Manage decision charts

  • You cannot edit a metric that's already used in a Decision and added to a chart.

Chart preview

Check out the docs for details.

Other 🌟

Quick links to Core & Chat SDK

Type: Enhancement

Apart from the product enhancements, we also introduced minor updates to the docs to facilitate your navigation experience.

To make it easier for you to browse the SDK docs, we added quick links to all Core and Chat SDKs.

Thanks to these links, you can quickly go back to the overviews for each SDK category.

  • Core SDKs
  • Chat SDKs

Core SDKs

Chat SDKs

Context switcher in Chat SDK

Type: Enhancement

In addition to the quick links mentioned, we also added a context switcher to the Chat SDK docs, which lets you easily switch from one Chat SDK documentation set to another.

Context switcher

documentation Article's
30 articles in total
Favicon
LaTeX for Beginners in 6 Minutes
Favicon
Using Direct Line botframework in a React Native Application to connect to Copilot Studio Agent
Favicon
The Importance of Writing Meaningful Code and Documentation
Favicon
Versioning in Go Huma
Favicon
Documentation Release Notes - December 2024
Favicon
What Content to Create and How to Publish It, Part 1
Favicon
Simplify Your Billing Process with an Invoice Template Google Docs
Favicon
Mastering Developer Documentation: A Journey Beyond the Basics
Favicon
Maintainability Is All You Need
Favicon
API Documentation: How to Write It, Template and Examples
Favicon
How to Write a Troubleshooting Guide That Actually Helps Users
Favicon
The Importance of Reading Documentation: A Lesson from Nvidia Drivers
Favicon
Unpacking Technical Debt: The Types Every Dev Should Know
Favicon
Reasons Why Developers Hate Your Docs
Favicon
Data Analytics Skills for Technical Writers
Favicon
How We Do Documentation Engineering
Favicon
[Boost]
Favicon
Things are moving fast! Check out Reldens new docs here: https://lnkd.in/dFjgAfge. It’s really worth it!
Favicon
JSDoc: La Guía Definitiva para Documentar tu Código JavaScript
Favicon
Dominando el Testing y la Documentación en React: Una Guía Completa
Favicon
AI in Healthcare Documentation: The Future of Medical Records
Favicon
Understanding User Needs in Technical Writing: How Frameworks Like Diátaxis Help
Favicon
Documentation Release Notes - November 2024
Favicon
How to view API request examples in a ReadMe documentation.
Favicon
Supercharge Your Project Documentation: Introducing project-readme-gen – An AI-Powered README Generator
Favicon
Invoice & Reimbursement Document Processing
Favicon
Understand cURL more in Just 10 Minutes!🔥🔥
Favicon
Moderniser son Dossier d'Architecture Technique : Guide pratique pour 2024
Favicon
The True Value of Your Product Lies in Its Documentation
Favicon
Integrating OpenAPI Documentation and Swagger UI in Spring Boot

Featured ones: