UnityUnity V4 Objects API Reference for Realtime Apps

 

These docs are for PubNub 4.x for Unity which is our latest and greatest! For the docs of the older versions of the SDK, please check PubNub 3.x for Unity.

If you have questions about the PubNub for Unity SDK, please contact us at support@pubnub.com.

This page describes the new Objects v2. To upgrade from Objects v1, refer to the migration guide.

Objects provides easy-to-use, serverless storage for user and channel data you need to build innovative, reliable, scalable applications. Use Objects to easily store metadata about your application users and channels, and their membership associations, without the need to stand up your own databases.

PubNub also triggers events when object data is set or removed from the database. Clients can receive these events in realtime and update their front-end application accordingly.

Returns a paginated list of UUID Metadata objects, optionally including the custom data object for each.

To Get All UUID Metadata you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    IncludePNUUIDMetadataInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNUUIDMetadataIncludeCustom
    LimitintOptional100Number of objects to return in response. Default is 100, which is also the maximum value.
    IncludeCountboolOptionalfalseRequest Count to be included in paginated response. By default, Count is omitted.
    StartstringOptionalnullPreviously-returned cursor bookmark for fetching the next page.
    EndstringOptionalnullPreviously-returned cursor bookmark for fetching the previous page. Ignored if you also supply the start parameter.
    FilterstringOptionalnullExpression used to filter the results. Only objects whose properties satisfy the given expression are returned. The filter language is defined here. In addition to custom attributes, the expressions can refer to attributes on associated entities one level deep (that is, the association and its target entities).
    SortList<string>OptionalfalseList of properties to sort by.
pubnub.GetAllUUIDMetadata().Async((result, status) => {
        Debug.Log("result.Next:" + result.Next);
        Debug.Log("result.Prev:" + result.Prev);
        Debug.Log("result.TotalCount:" + result.TotalCount);
        if (result.Data != null)
        {
            foreach (PNUUIDMetadataResult pnUUIDMetadataResult in result.Data)
            {
                Debug.Log(pnUUIDMetadataResult.Name);
                Debug.Log(pnUUIDMetadataResult.Email);
                Debug.Log(pnUUIDMetadataResult.ExternalID);
                Debug.Log(pnUUIDMetadataResult.ProfileURL);
                Debug.Log(pnUUIDMetadataResult.ETag);
                Debug.Log(pnUUIDMetadataResult.Custom);
            }
        }
});

The GetAllUUIDMetadata() operation returns a type PNGetAllUUIDMetadataResult which contains the following properties:


Property NameTypeDescription
DataList<PNUUIDMetadataResult>Details of type PNUUIDMetadataResult are here.
TotalCountlongTotal count of objects without pagination.
NextstringCursor bookmark for fetching next page.
PrevstringCursor bookmark for fetching prev page.

Returns metadata for the specified UUID, optionally including the custom data object for each.

To Get UUID Metadata you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    UUIDstringYespubnub.configuration.uuidUnique UUID Metadata identifier. If not supplied, then UUID from configuration will be used.
    IncludePNUUIDMetadataInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNUUIDMetadataIncludeCustom
pubnub.GetUUIDMetadata().UUID("testuuid").Async((result, status) =>
    {
        Debug.Log(result.Name);
        Debug.Log(result.Email);
        Debug.Log(result.ExternalID);
        Debug.Log(result.ProfileURL);
        Debug.Log(result.ID);
        Debug.Log(result.ETag);
    });

The GetUUIDMetadata() operation returns a type PNUUIDMetadataResult which contains the following properties:

PNUUIDMetadataResult contains the following properties:


Property NameTypeDescription
IDstringUnique user identifier. If not supplied then current user’s uuid is used.
NamestringDisplay name for the user. Maximum 200 characters.
ExternalIDstringUser's identifier in an external system.
ProfileURLstringThe URL of the user's profile picture.
EmailstringThe user's email address. Maximum 80 characters.
CustomDictionary<string, object>JSON object of key-value pairs with supported data types.
UpdatedstringLast updated date.
ETagstringThe ETag.

Set metadata for a UUID in the database, optionally including the custom data object for each.

To Set UUID Metadata you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    IncludePNUUIDMetadataInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNUUIDMetadataIncludeCustom
    UUIDstringYesnullUnique user identifier. If not supplied then current user’s uuid is used.
    NamestringYesnullDisplay name for the user.
    Maximum 200 characters.
    ExternalIdstringOptionalnullUser's identifier in an external system
    ProfileUrlstringOptionalnullThe URL of the user's profile picture
    EmailstringOptionalnullThe user's email address.
    Maximum 80 characters.
    CustomDictionary<string, object>OptionalnullAny object of key-value pairs with supported data types.
    IncludePNUUIDMetadataInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNUUIDMetadataIncludeCustom
pubnub.SetUUIDMetadata().Email("email").ExternalID("extid").Name("name").UUID("testuuid").ProfileURL("profileurl").Async((result, status) => {
    Debug.Log(result.Name);
    Debug.Log(result.Email);
    Debug.Log(result.ExternalID);
    Debug.Log(result.ProfileURL);
    Debug.Log(result.ID);
    Debug.Log(result.ETag);

});

The SetUUIDMetadata() operation returns a type PNUUIDMetadataResult. Details of type PNUUIDMetadataResult are here.

Removes the metadata from a specified UUID.

To Remove UUID Metadata you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDescription
    UUIDstringOptionalUnique user identifier. If not supplied then current user’s uuid is used.
pubnub.RemoveUUIDMetadata().UUID("testuuid").Async((result, status) => {
        Debug.Log(status.Error);
    });

The RemoveUUIDMetadata() operation returns a type PNRemoveUUIDMetadataResult which is empty.

Returns a paginated list of Channel Metadata objects, optionally including the custom data object for each.

To Get All Channel Metadata you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    IncludePNChannelMetadataInclude[]OptionalList of additional/complex channel attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNChannelMetadataIncludeCustom
    LimitintOptional100Number of objects to return in response. Default is 100, which is also the maximum value.
    CountboolOptionalfalseRequest Count to be included in paginated response. By default, Count is omitted.
    StartstringOptionalnullPreviously-returned cursor bookmark for fetching the next page.
    EndstringOptionalnullPreviously-returned cursor bookmark for fetching the previous page. Ignored if you also supply the start parameter.
    FilterstringOptionalnullExpression used to filter the results. Only objects whose properties satisfy the given expression are returned. The filter language is defined here. In addition to custom attributes, the expressions can refer to attributes on associated entities one level deep (that is, the association and its target entities).
    SortList<string>OptionalfalseList of properties to sort by.
pubnub.GetAllChannelMetadata().Async((result, status) => {
    if (result.Data != null)
    {
        Debug.Log("result.Next:" + result.Next);
        Debug.Log("result.Prev:" + result.Prev);
        Debug.Log("result.TotalCount:" + result.TotalCount);

        foreach (PNChannelMetadataResult m in result.Data)
        {
            Debug.LOg(result.Data[i].ID);  
        }
    }
});

The GetAllChannelMetadata() operation returns a type PNGetAllChannelMetadataResult.

Property NameTypeDescription
DataList<PNChannelMetadataResult>Details of type PNChannelMetadataResult are here.
TotalCountlongTotal count of objects without pagination.
NextstringCursor bookmark for fetching next page.
PrevstringCursor bookmark for fetching prev page.

Returns metadata for the specified Channel, optionally including the custom data object for each.

To Get Channel Metadata you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    ChannelstringYesChannel name.
    IncludePNChannelMetadataInclude[]OptionalList of additional/complex space attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNChannelMetadataIncludeCustom.
pubnub.GetChannelMetadata().Channel("testchannel").Async((result, status) =>
    {
        Debug.Log(result.Name);
        Debug.Log(result.Description);
        Debug.Log(result.ID);
        Debug.Log(result.ETag);
    });

The GetChannelMetadata() operation returns a type PNChannelMetadataResult.

Property NameTypeDescription
IDstringUnique user identifier. If not supplied then current user’s uuid is used.
NamestringDisplay name of the channel. Maximum 200 characters.
DescriptionstringDescription of the channel. Maximum 80 characters.
CustomDictionary<string, object>JSON object of key-value pairs with supported data types.
UpdatedstringLast updated date.
ETagstringThe ETag.

Set metadata for a Channel in the database, optionally including the custom data object for each.

To Set Channel Metadata you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    IncludePNChannelMetadataInclude[]OptionalList of additional/complex channel attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNChannelMetadataIncludeCustom
    ChannelstringYesChannel Metadata identifier.
    NamestringOptionalName of a channel.
    DescriptionstringOptionalDescription of a channel.
    CustomDictionary<string, object>OptionalnullAny object of key-value pairs with supported data types.
pubnub.SetChannelMetadata().Name(channelMetadataname2).Channel(channelMetadataID2).Include(channelMetadataInclude).Custom(channelMetadataCustom2).Description(channelMetadatadesc2).Async((result, status) => {
        Debug.Log(result.Name);
        Debug.Log(result.Description);
        Debug.Log(result.ID);
        Debug.Log(result.ETag);

    });

The SetChannelMetadata() operation returns a type PNChannelMetadataResult. Details of PNChannelMetadataResult are here.

Removes the metadata from a specified channel.

To Remove Channel Metadata you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    ChannelstringYesChannel name.
pubnub.RemoveChannelMetadata().Channel("testchannel").Async((result, status) => {
        Debug.Log(status.Error);
    });

The RemoveChannelMetadata() operation returns a type PNRemoveChannelMetadataResult which is empty.

The method returns a list of channel memberships for a user. This method doesn't return a user's subscriptions.

To Get Memberships you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    UUIDstringOptionalUnique user identifier. If not supplied then current user’s UUID is used.
    IncludePNMembershipsInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNMembershipsIncludeCustom,PNMembershipsIncludeChannel,PNMembershipsIncludeChannelCustom.
    LimitintOptional100Number of objects to return in response. Default is 100, which is also the maximum value.
    CountboolOptionalfalseRequest Count to be included in paginated response. By default, Count is omitted.
    StartstringOptionalnullPreviously-returned cursor bookmark for fetching the next page.
    EndstringOptionalnullPreviously-returned cursor bookmark for fetching the previous page. Ignored if you also supply the start parameter.
    FilterstringOptionalnullExpression used to filter the results. Only objects whose properties satisfy the given expression are returned. The filter language is defined here. In addition to custom attributes, the expressions can refer to attributes on associated entities one level deep (that is, the association and its target entities).
    SortList<string>OptionalnullList of properties to sort by.
pubnub.GetMemberships().UUID("testuuid").Async((result, status) =>
    {
        if (result.Data != null)
        {
            var resultData = result.Data as List;
            foreach (PNMemberships m in result.Data)
            {
                Debug.Log(resultData[i].ID)
            }
        }
    });

The GetMemberships() operation returns a PNGetMembershipsResult which contains the following parameters:

  1. Property NameTypeDescription
    DataList<PNMemberships>Details of type PNMemberships are here.
    TotalCountlongTotal count of objects without pagination.
    NextstringCursor bookmark for fetching next page.
    PrevstringCursor bookmark for fetching prev page.
  1. Property NameTypeDescription
    IDstringUnique user identifier. If not supplied then current user’s UUID is used.
    ChannelPNChannelMetadataResultDisplay name for the user. Maximum 200 characters.
    CreatedstringCreated date.
    CustomDictionary<string, object>JSON object of key-value pairs with supported data types.
    UpdatedstringLast updated date.
    ETagstringThe ETag.

Set channel memberships for a UUID.

To Set Memberships you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    SetList<PNMembershipSet>Optional List of channels (as [PNMembershipsSet] to set for membership.
    UUIDstringOptionalUnique user identifier. If not supplied then current user’s UUID is used.
    IncludePNMembershipsInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNMembershipsIncludeCustom,PNMembershipsIncludeChannel,PNMembershipsIncludeChannelCustom.
    LimitintOptional100Number of objects to return in response. Default is 100, which is also the maximum value.
    CountboolOptionalfalseRequest Count to be included in paginated response. By default, Count is omitted.
    StartstringOptionalnullPreviously-returned cursor bookmark for fetching the next page.
    EndstringOptionalnullPreviously-returned cursor bookmark for fetching the previous page. Ignored if you also supply the start parameter.
    SortList<string>OptionalnullList of properties to sort by.
PNMembershipsSet inputMemberships = new PNMembershipsSet();
inputMemberships.Channel = new PNMembershipsChannel {
        ID = "channelID"
    };

pubnub.SetMemberships().UUID("testuuid").Set(new List { inputMemberships }.Async((result, status) => {
        Debug.Log("result.Next:" + result.Next);
        Debug.Log("result.Prev:" + result.Prev);
        Debug.Log("result.TotalCount:" + result.TotalCount);

        foreach (PNMemberships mem in result.Data)
        {
            Debug.Log(mem.Channel.ID);
            Debug.Log(mem.Channel.Name);
            Debug.Log(mem.Channel.Description);
            Debug.Log(mem.Channel.ID);
        }
    });

The SetMemberships() operation returns a PNSetMembershipsResult which contains the following parameters:

  1. Property NameTypeDescription
    DataList<PNMemberships>Details of type PNMemberships are here.
    TotalCountlongTotal count of objects without pagination.
    NextstringCursor bookmark for fetching next page.
    PrevstringCursor bookmark for fetching previous page.

Remove channel memberships for a UUID.

To Remove Memberships you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    RemoveList<PNMembershipRemove>Optional List of channels (as [PNMembershipsRemove] to remove membership for.
    UUIDstringOptionalUnique user identifier. If not supplied then current user’s UUID is used.
    IncludePNMembershipsInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNMembershipsIncludeCustom,PNMembershipsIncludeChannel,PNMembershipsIncludeChannelCustom.
    LimitintOptional100Number of objects to return in response. Default is 100, which is also the maximum value.
    CountboolOptionalfalseRequest Count to be included in paginated response. By default, Count is omitted.
PNMembershipsRemove inputMembershipsRm = new PNMembershipsRemove();
inputMembershipsRm.Channel = new PNMembershipsChannel {
        ID = "channelID"
    };

pubnub.RemoveMemberships().UUID("testuuid").Remove(new List { inputMembershipsRm }).Async((result, status) => {
        Debug.Log("result.Next:" + result.Next);
        Debug.Log("result.Prev:" + result.Prev);
        Debug.Log("result.TotalCount:" + result.TotalCount);

        foreach (PNMemberships mem in result.Data)
        {
            Debug.Log(mem.Channel.ID);
            Debug.Log(mem.Channel.Name);
            Debug.Log(mem.Channel.Description);
            Debug.Log(mem.Channel.ID);
        }
    });

The RemoveMemberships() operation returns a type PNManageMembershipsResult. Details of type PNManageMembershipsResult are here.

Manage a user's channel memberships.

To Manage Memberships you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    SetList<PNMembershipsSet>Optional List of channels (as [PNMembershipsSet] to set for membership.
    RemoveList<<PNMembershipsRemove>Optional List of channels (as [PNMembershipsRemove] to remove membership for.
    UUIDstringOptionalUnique user identifier. If not supplied then current user’s UUID is used.
    IncludePNMembershipsInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNMembershipsIncludeCustom,PNMembershipsIncludeChannel,PNMembershipsIncludeChannelCustom.
    LimitintOptional100Number of objects to return in response. Default is 100, which is also the maximum value.
    CountboolOptionalfalseRequest Count to be included in paginated response. By default, Count is omitted.
PNMembershipsSet inputMemberships = new PNMembershipsSet();
inputMemberships.Channel = new PNMembershipsChannel {
        ID = "channelID"
    };

pubnub.ManageMemberships().UUID("testuuid").Set(new List { inputMemberships }).Async((result, status) => {
        Debug.Log("result.Next:" + result.Next);
        Debug.Log("result.Prev:" + result.Prev);
        Debug.Log("result.TotalCount:" + result.TotalCount);

        foreach (PNMemberships mem in result.Data)
        {
            Debug.Log(mem.Channel.ID);
            Debug.Log(mem.Channel.Name);
            Debug.Log(mem.Channel.Description);
            Debug.Log(mem.Channel.ID);
        }

    });

The ManageMemberships() operation returns a type PNManageMembershipsResult. Details of type PNManageMembershipsResult are here.

The method returns a list of members in a channel. The list will include user metadata for members that have additional metadata stored in the database.

To Get Channel Members you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    IncludePNChannelMembersInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNChannelMembersIncludeCustom, PNChannelMembersIncludeUUID, PNChannelMembersIncludeUUIDCustom.
    LimitintOptional100Number of objects to return in response. Default is 100, which is also the maximum value.
    IncludeCountboolOptionalfalseRequest Count to be included in paginated response. By default, Count is omitted.
    StartstringOptionalnullPreviously-returned cursor bookmark for fetching the next page.
    EndstringOptionalnullPreviously-returned cursor bookmark for fetching the previous page. Ignored if you also supply the start parameter.
    FilterstringOptionalnullExpression used to filter the results. Only objects whose properties satisfy the given expression are returned. The filter language is defined here. In addition to custom attributes, the expressions can refer to attributes on associated entities one level deep (that is, the association and its target entities).
    SortList<string>OptionalfalseList of properties to sort by.
pubnub.GetChannelMembers().Channel("testchannel").Async((result, status) =>
    {
        Debug.Log("result.Next:" + result.Next);
        Debug.Log("result.Prev:" + result.Prev);
        Debug.Log("result.TotalCount:" + result.TotalCount)
        if (result.Data != null)
        {
            foreach (PNMembers m in result.Data)
            {
                Debug.Log(result.Data[i].ID);
            }
        }
    });

The GetChannelMembers() operation returns a type PNGetChannelMembersResult.

Property NameTypeDescription
IDstringUnique user identifier. If not supplied then current user’s uuid is used.
DataList<PNMembers>Details of type PNMembers are here.
TotalCountlongTotal count of objects without pagination.
NextstringCursor bookmark for fetching next page.
PrevstringCursor bookmark for fetching next page.
Property NameTypeDescription
UUIDPNUUIDMetadataResultDetails of type PNUUIDMetadataResult are here

This method sets members in a channel.

To Set Channel Members you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    SetList<PNChannelMembersSet>Optional List of channels (as [PNChannelMembersSet] to set for membership.
    ChannelstringYesChannel name.
    IncludePNChannelMembersInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNChannelMembersIncludeIncludeCustom,PNChannelMembersIncludeChannel,PNChannelMembersIncludeChannelCustom.
    LimitintOptional100Number of objects to return in response. Default is 100, which is also the maximum value.
    CountboolOptionalfalseRequest Count to be included in paginated response. By default, Count is omitted.
    StartstringOptionalnullPreviously-returned cursor bookmark for fetching the next page.
    EndstringOptionalnullPreviously-returned cursor bookmark for fetching the previous page. Ignored if you also supply the start parameter.
    FilterstringOptionalnullExpression used to filter the results. Only objects whose properties satisfy the given expression are returned. The filter language is defined here. In addition to custom attributes, the expressions can refer to attributes on associated entities one level deep (that is, the association and its target entities).
    SortList<string>OptionalnullList of properties to sort by.

PNChannelMembersSet input = new PNChannelMembersSet();
input.UUID =  new PNChannelMembersUUID {
        ID = uuidMetadataid
    };
pubnub.SetChannelMembers().Channel("testchannel").Set(new List { input }).Async((result, status) => {
    Debug.Log("result.Next:" + result.Next);
    Debug.Log("result.Prev:" + result.Prev);
    Debug.Log("result.TotalCount:" + result.TotalCount);
    foreach (PNMembers mem in result.Data)
    {
        Debug.Log(mem.UUID.ID);
        Debug.Log(mem.UUID.Name);
        Debug.Log(mem.UUID.Email);
        Debug.Log(mem.UUID.ExternalID);
        Debug.Log(mem.UUID.ProfileURL);
        Debug.Log(mem.UUID.ID);
        Debug.Log(mem.UUID.ETag);
    }
});

The SetChannelMembers() operation returns a type PNManageChannelMembersResult.

Property NameTypeDescription
DataList<PNMembers>Details of type PNMembers are here.
TotalCountlongTotal count of objects without pagination.
NextstringCursor bookmark for fetching next page.
PrevstringCursor bookmark for fetching next page.

Remove members from a Channel.

To Remove Channel Members you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    RemoveList<PNChannelMembersRemove>Optional List of channels (as [PNChannelMembersRemove] to remove a membership for.
    ChannelstringYesChannel name.
    IncludePNChannelMembersInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNChannelMembersIncludeIncludeCustom,PNChannelMembersIncludeChannel,PNChannelMembersIncludeChannelCustom.
    LimitintOptional100Number of objects to return in response. Default is 100, which is also the maximum value.
    CountboolOptionalfalseRequest Count to be included in paginated response. By default, Count is omitted.
    StartstringOptionalnullPreviously-returned cursor bookmark for fetching the next page.
    EndstringOptionalnullPreviously-returned cursor bookmark for fetching the previous page. Ignored if you also supply the start parameter.
    FilterstringOptionalnullExpression used to filter the results. Only objects whose properties satisfy the given expression are returned. The filter language is defined here. In addition to custom attributes, the expressions can refer to attributes on associated entities one level deep (that is, the association and its target entities).
    SortList<string>OptionalnullList of properties to sort by.
PNChannelMembersRemove inputRm = new PNChannelMembersRemove();
inputRm.UUID = new PNChannelMembersUUID {
        ID = uuidMetadataid
    };;

pubnub.RemoveChannelMembers().Channel("testchannel").Remove(new List { inputRm }).Async((result, status) => {
        foreach (PNMembers mem in result.Data)
        {
            Debug.Log("result.Next:" + result.Next);
            Debug.Log("result.Prev:" + result.Prev);
            Debug.Log("result.TotalCount:" + result.TotalCount);
            foreach (PNMembers mem in result.Data)
            {
                Debug.Log(mem.UUID.ID);
                Debug.Log(mem.UUID.Name);
                Debug.Log(mem.UUID.Email);
                Debug.Log(mem.UUID.ExternalID);
                Debug.Log(mem.UUID.ProfileURL);
                Debug.Log(mem.UUID.ID);
                Debug.Log(mem.UUID.ETag);
            }
        }
    });

The RemoveChannelMembers() operation returns a type PNManageChannelMembersResult. Details of type PNManageChannelMembersResult can be found here.

Manage the members of a channel.

To Manage Channel Members you can use the following method(s) in the Unity V4 SDK:

  1. ParameterTypeRequiredDefaultDescription
    SetList<PNChannelMembersSet>Optional List of channels (as [PNChannelMembersSet] to set for membership.
    RemoveList<PNChannelMembersRemove>Optional List of channels (as [PNChannelMembersRemove] to remove a membership for.
    ChannelstringYesChannel name.
    IncludePNChannelMembersInclude[]OptionalList of additional/complex UUID attributes to include in response. Omit this parameter if you don't want to retrieve additional attributes. Available values: PNChannelMembersIncludeIncludeCustom,PNChannelMembersIncludeChannel,PNChannelMembersIncludeChannelCustom.
    LimitintOptional100Number of objects to return in response. Default is 100, which is also the maximum value.
    CountboolOptionalfalseRequest Count to be included in paginated response. By default, Count is omitted.
    StartstringOptionalnullPreviously-returned cursor bookmark for fetching the next page.
    EndstringOptionalnullPreviously-returned cursor bookmark for fetching the previous page. Ignored if you also supply the start parameter.
    FilterstringOptionalnullExpression used to filter the results. Only objects whose properties satisfy the given expression are returned. The filter language is defined here. In addition to custom attributes, the expressions can refer to attributes on associated entities one level deep (that is, the association and its target entities).
    SortList<string>OptionalnullList of properties to sort by.
PNChannelMembersSet input = new PNChannelMembersSet();
input.UUID =  new PNChannelMembersUUID {
        ID = uuidMetadataid
    };

pubnubObjects.ManageChannelMembers().Channel("testchannel").Set(new List { input }).Remove(new List { }).Async((result, status) => {
        foreach (PNMembers mem in result.Data)
        {
            Debug.Log("result.Next:" + result.Next);
            Debug.Log("result.Prev:" + result.Prev);
            Debug.Log("result.TotalCount:" + result.TotalCount);
            foreach (PNMembers mem in result.Data)
            {
                Debug.Log(mem.UUID.ID);
                Debug.Log(mem.UUID.Name);
                Debug.Log(mem.UUID.Email);
                Debug.Log(mem.UUID.ExternalID);
                Debug.Log(mem.UUID.ProfileURL);
                Debug.Log(mem.UUID.ID);
                Debug.Log(mem.UUID.ETag);
            }
        }
    });

The ManageChannelMembers() operation returns a type PNManageChannelMembersResult. Details of type PNManageChannelMembersResult can be found here.

The filtering language for Objects is similar to the stream filtering language.

Note the following:

  • Date/time properties, such as updated, must be compared to valid date/time strings formatted according to ISO 8601.
  • Custom properties must have the same type as the value used in the expression; it is an error to compare a custom property of one type to a value of another type.
  • Objects that do not have the referenced custom property at all are excluded regardless of the operator or value used in the expression. The null value can be used to filter out objects that do or do not have the referenced custom property.
  • The LIKE operator supports wildcards denoted by the * character. A wildcard matches any sequence of arbitrary Unicode characters, including the empty sequence. The literal asterisk is matched when escaped using the backslash (\) character.
  • Values used with LIKE must be properly encoded just like any other string value. Thus, in order to escape an asterisk, the raw value must contain \\*.
  • The entire expression must be properly URL-encoded when used in the query string.

<expression>           ::= <and_expression> ( "||" <and_expression> )*
<and_expression>       ::= <binary_condition> ( "&&" <binary_condition> )*
<binary_condition>     ::= "!" <binary_condition> | "(" <expression> ")" | <relational_condition>
<relational_condition> ::= <property_path> <relational_operator> <value>
<property_path>        ::= <property_name> ( "." <property_name> )*
<property_name>        ::= <identifier> | "[" <string> "]"
<value>                ::= <string> | <number> | "true" | "false" | "null"

Tokens

<identifier>           ::=  <letter> | "$" | "_" ( <letter> | "$" | "_" | <digit> )*
<relational_operator>  ::= "==" | "!=" | "<=" | ">=" | "<" | ">" | "LIKE"
<string>               ::= <double_quote> ( "\" <double_quote> | "\" <special_char>
                            | "\" "u" <hex_digit> <hex_digit> <hex_digit> <hex_digit>
                            | <unicode_char> - <double_quote> - "\" )* <double_quote>
                            | "'" ( "\" "'" | "\" <special_char>
                            | "\" "u" <hex_digit> <hex_digit> <hex_digit> <hex_digit>
                            | <unicode_char> - "'" - "\" )* "'"
<number>               ::= ( "+" | "-" )? ( <digit> )* ( "." )? <digit> ( <digit> )* 
                            ( "e" | "E" ( "+" | "-" )? <digit> ( <digit> )* )?
<letter>               ::= Unicode Letter (category; any kind of letter from any language)
<digit>                ::= "0" .. "9"
<hex_digit>            ::= <digit> | "A" .. "F"
<double_quote>         ::= the " character
<unicode_char>         ::= any character in the Unicode range from U+0020 to U+10FFFF inclusive
<special_char>         ::= "\" | "/" | "b" | "f" | "n" | "r" | "t"

The following simple expression returns results whose custom property named public is equal to Boolean true.


custom.public == true

The following date/time comparison returns results that were modified on or after August 31st, 2019 (UTC):


updated >= "2019-08-31T00:00:00Z"

The following compound expression returns results that don't have a description, but do have a non-empty custom label or description property:


description == null && (custom.label != "" || custom.description != "")

The following wildcard expression returns results whose name starts with the letter X:


name LIKE 'X*'

The following escaped wildcard expression returns results whose name contains an asterisk:


name LIKE '*\\**'