C-Core (legacy) SDK 6.0.0 migration guide

New SDK available

C-Core (legacy) is still supported. If you are starting a new project, use the new C SDK.

This guide summarizes the differences between pre-6.0.0 versions and 6.0.0 and shows how to migrate to C-Core SDK 6.0.0.

C-Core (legacy) SDK version 6.0.0 adds pagination support to the Here Now API through new limit and offset fields on pubnub_here_now_options. This applies to all C-Core (legacy) SDK flavors: C-Core (legacy), POSIX C, POSIX C++, Windows C, Windows C++, FreeRTOS, and Mbed.

No pre-6.0.0 support

If your application uses C-Core (legacy) SDK pre-6.0.0, it continues to work. We recommend migrating to C-Core 6.0.0 to access new features and improvements. Pre-6.0.0 versions receive only critical security fixes.

What has changed​

See the major differences between versions:

FeatureC-Core (legacy) SDK pre-6.0.0C-Core SDK 6.0.0
pubnub_here_now_options structFields: channel_group, disable_uuids, stateAdded: limit (1–1000), offset (pagination)
pubnub_here_now_defopts() defaults{NULL, false, false}{NULL, false, false, 1000, 0}

Breaking changes​

Here Now API​

Starting with 6.0.0, the pubnub_here_now_options struct in core/pubnub_coreapi_ex.h gained two new fields for pagination support.

Struct changes​

struct pubnub_here_now_options {
char const* channel_group;
bool disable_uuids;
bool state;
unsigned limit; /* NEW — max users to return (1–1000) */
unsigned offset; /* NEW — pagination offset */
};

Default value changes​

pubnub_here_now_defopts() now returns:

FieldC-Core (legacy) SDK pre-6.0.0C-Core (legacy) SDK 6.0.0
channel_groupNULLNULL (unchanged)
disable_uuidsfalsefalse (unchanged)
statefalsefalse (unchanged)
limitN/A1000
offsetN/A0
/* Simple here_now call — no pagination available */
struct pubnub_here_now_options opts = pubnub_here_now_defopts();
pubnub_here_now_ex(pb, "my-channel", opts);

Migration steps​

To migrate to C-Core SDK 6.0.0:

  1. Update your SDK to version 6.0.0.

  2. Review Here Now API usage:

    ActionDescription
    If you use pubnub_here_now_ex() with custom options, the struct now includes limit and offset fieldsAlways use pubnub_here_now_defopts() to initialize options. The new fields default to limit=1000 and offset=0, which preserves existing behavior.
    If your channels have more than 1,000 occupants, implement pagination logicUse the limit and offset fields to paginate through results.
  3. Recompile your project. The struct size has changed, so all compilation units using pubnub_here_now_options must be rebuilt.

  4. Test your application. Pay special attention to presence operations.

Additional resources​

For API details, see the C-Core (legacy) SDK documentation. For questions or issues, contact PubNub support.

Was this page useful?

Last updated on