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/Method | Unity SDK 6.x.x | Unity SDK 7.x.x |
---|---|---|
Namespaces | PubNubAPI | PubnubApi PubnubApi.Unity |
Instance name | PubNub | Pubnub |
JSON Library | PubNub.JsonLibrary | Pubnub.JsonPluggableLibrary |
Message Payload | PNMessageResult.Payload | PNMessageResult.Message |
Signal Payload | PNSignalResult.Payload | PNSignalResult.Message |
Push Notifications Removal | PubNub.RemoveAllPushNotifications | Pubnub.RemoveAllPushNotificationsFromDeviceWithPushToken |
Execution Method | Async | Execute Consider using the new ExecuteAsync method (returns a Task ) that enables the await C# feature. |
Message Fetching | PubNub.FetchMessages | Pubnub.FetchHistory |
Unsubscribe Method | Unsubscribe.Execute accepts a callback. | Unsubscribe.Execute doesn't accept a callback. |
Device ID | DeviceID | DeviceId |
File Name | File.Name | .FileName |
File Path | File.FilePath | .File |
Post Method | Publish.UsePost | Publish.UsePOST |
Unsubscribe All | UnsubscribeAll is not instant. | UnsubscribeAll is instant, doesn't accept arguments. |
Clean Up | CleanUp is available. | CleanUp is removed, use UnsubscribeAll instead. |
Error Data | PNErrorData.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.