Unity 7.0.0 Migration Guide

Unity SDK version 7.0.0 is an updated version of the existing Unity SDK that allows you to interact with PubNub from Unity Editor. This document is aimed at developers who already use < 7.0.0 of Unity SDK in their existing applications.

If your application uses Unity SDK <= 6.x.x, we'll continue to process your requests. However, we strongly recommend migrating to the new Unity 7.0.0 as the 6.x.x SDK will no longer receive the latest updates.

This guide provides an overview of all differences between the two versions and documents the steps you need to follow to migrate to Unity SDK 7.0.0.

Differences between 6.x.x and 7.0.0

While the way customer applications use Unity SDK hasn't changed fundamentally from 6.x.x to 7.0.0, the new version is significantly more Unity-specific, allowing for much faster integration of PubNub functionality within your Unity project. Moreover, the new 7.0.0 version supports use cases specific to game development, like sending textures. For more details on specific APIs, refer to Unity SDK documentation.

See all the major differences between the two versions:

Feature/MethodUnity SDK 6.x.xUnity SDK 7.x.x
NamespacesPubNubAPIPubnubApi
PubnubApi.Unity
Instance namePubNubPubnub
JSON LibraryPubNub.JsonLibraryPubnub.JsonPluggableLibrary
Message PayloadPNMessageResult.PayloadPNMessageResult.Message
Signal PayloadPNSignalResult.PayloadPNSignalResult.Message
Push Notifications RemovalPubNub.RemoveAllPushNotificationsPubnub.RemoveAllPushNotificationsFromDeviceWithPushToken
Execution MethodAsyncExecute

Consider using the new ExecuteAsync method (returns a Task) that enables the await C# feature.
Message FetchingPubNub.FetchMessagesPubnub.FetchHistory
Unsubscribe MethodUnsubscribe.Execute accepts a callback.Unsubscribe.Execute doesn't accept a callback.
Device IDDeviceIDDeviceId
File NameFile.Name.FileName
File PathFile.FilePath.File
Post MethodPublish.UsePostPublish.UsePOST
Unsubscribe AllUnsubscribeAll is not instant.UnsubscribeAll is instant, doesn't accept arguments.
Clean UpCleanUp is available.CleanUp is removed, use UnsubscribeAll instead.
Error DataPNErrorData.Ex
PNErrorData.Info
PNErrorData.Throwable
PNErrorData.Information

Migration steps

To migrate from the Unity SDK version 6.x.x to 7.0.0, upgrade the SDK version in your project, inspect the differences listed in the table, and change your code accordingly.

Last updated on