Unity 7.0.0 Migration Guide

Unity SDK version 7.0.0 lets you use PubNub from the Unity Editor. This enables real‑time testing, debugging, and prototyping without building to target platforms.

This guide is for developers who use Unity SDK earlier than 7.0.0 in existing applications.

If your application uses Unity SDK 6.x.x or earlier, it continues to work. We recommend migrating to Unity 7.0.0 because 6.x.x won't receive new features.

This guide summarizes the differences between the versions and shows how to migrate to Unity SDK 7.0.0.

Differences between 6.x.x and 7.0.0​

While how applications use the Unity SDK hasn't changed fundamentally from 6.x.x to 7.0.0, the new version is more Unity‑specific. It speeds up integrating PubNub into your Unity project. Version 7.0.0 also supports game‑development use cases, like sending textures. For API details, see the Unity SDK documentation.

See 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 Unity SDK 6.x.x to 7.0.0, upgrade the SDK in your project, review the differences listed in the table, and update your code accordingly.

Was this page useful?

Last updated on