SelectUpgrading Xamarin.Mac V3 to V4

These docs are for version 3.8.7 of the Xamarin.Mac SDK. To check out the docs for the latest version Click Here.

PubNub 4.0 for C# is our latest and greatest! Please click here for our PubNub 4.0 for C# docs and SDK.

PubNub 3.x for C# will encounter End Of Life (EOL) Aug 1st, 2018. All users currently on 3.x should begin migrating to 4.x. The 3.x SDK will continue to work. We will no longer support it and if you run into an issue, we will request that you upgrade to the latest version before solving the issue.

If you have questions about the PubNub for C# SDK, please contact us at

  • V3 exposes PubNubMessaging.Core
  • V4 exposes PubnubApi
 Always set the UUID to uniquely identify the user or device that connects to PubNub. This UUID should be persisted, and should remain unchanged for the lifetime of the user or the device. Not setting the UUID can significantly impact your billing if your account uses the Monthly Active Users (MAUs) based pricing model, and can also lead to unexpected behavior if you have Presence enabled.
  • V3 initiates via:
    Pubnub(string publishKey, string subscribeKey, string secretKey, string cipherKey, bool sslOn)
  • V4 initiates via:
    Pubnub(PNConfiguration config)
  • V3 has DetailedHistory request.
  • V4 has History request.
  • V3 contains all arguments(with few overloaded) in the same generic method call:
    pubnub.DetailedHistory<string>(channel:"hi", count: 100, includeToken: true, userCallback: DisplayReturnMessage, errorCallback: DisplayErrorMessage)
  • V4 uses fluent style method calls.
        .Async(new PNHistoryResultExt((result, status) => {
  • V3 sends the response either as string or object. User needs to parse the output of callback.
  • V4 sends the response as static object(Eg. PNHistoryResult, PNPublishResult) based on the request.
  • V3 subscribe supports string or object types. It does not support custom classes.
  • V4 subscribe supports custom classes.
  • V3 publish supports JSON serialized message with pubnub.EnableJsonEncodingForPublish = false.
  • V4 publish do not support anymore with serialized JSON messages. SDK expects full object as the message payload.
  • V3 exposes the connect/disconnect callbacks on subscribe.
  • V4 exposes the functionality via the listener on status portion of the listener, please listen to PNConnectedCategory/PNDisconnectedCategory on the status category.
  • V3 exposes Presence() method for connecting/disconnect presence subscribes.
  • V4 exposes the Presence functionality as part of Subscribe. Use WithPresence to enable presence. Presence callback handled via the listener on presence portion of the listener, please listen to PNPresenceEventResult on the Presence callback.
  • V3 exposes logging capability through config appSettings(Non-PCL) and through pubnub. SetPubnubLog(IPubnubLog pubnubLog) method.
  • V4 exposes logging capability through PNLogVerbosity.BODY of PNConfiguration. IPubnubLog needs to be implemented and set PubnubLog of PNConfiguration.
  • V3 by default sets EnableResumeOnReconnect to true to re-try connect when interne/network fails.
  • V4 by default sets PNReconnectionPolicy.NONE for ReconnectionPolicy of PNConfiguration.