Unity Migration Guide

Migrating to Version 4.2.x

Version 4.2 reorganizes the wrapped iOS SDK which requires the removal of the old version prior to importing the new version.

 

From v4:

Remove the entire Kochava directory.

  • Assets/Kochava

From v3:

Remove all files that start with the given prefix.

  • Assets/Plugins/iOS/Kochava*
  • Assets/Plugins/iOS/KVA*
  • Assets/Plugins/iOS/libKochava*

Migrating to Version 4.x

Version 4 is a reorganization of the version 3 SDK where all code and resources are now placed under a top level Assets\Kochava directory instead of being placed in Assets\Plugins directly. New integrations will automatically import under the new structure. When upgrading from version 3 Unity will automatically detect the files are the same and place them in the same locations as version 3 used.

If you are migrating from a version prior to version 3 ensure you also complete the migrating to version 3 steps below.


Migrating to Version 3.x

Version 3.0.0 of the Kochava Unity SDK is a substantial overhaul which adds new support for VR (Oculus Rift and HTC Vive), MacOSX, Linux, Windows Desktop and WebGL (in addition to iOS and Android).

Integration:

Before importing the new unity package you must delete some of the old Kochava SDK files which are no longer used. Delete the following files if they exist before importing the new package:

  • Assets\Plugins\Android\_KOCHAVA_SAMPLE_AndroidManifest.xml
  • Assets\Plugins\Android\KochavaSDK.jar
  • Assets\Plugins\Android\KochavaUnity.dll
  • Assets\Plugins\iOS\KochavaUnity.dll
  • Assets\Plugins\Kochava\_Kochava Analytics.prefab
  • Assets\Plugins\Kochava\KochavaEditor.cs
  • Assets\Plugins\Kochava\KochavaUnity.dll
  • (any remaining files will be replaced)

 

You will also need to remove your existing _Kochava Analytics object from your scene if it exists. A new prefab will be provided. Before doing this make sure to save your current App GUIDs as they will be cleared when removed.

Now that you have removed the deprecated files you are ready to import the new SDK (version 3.0.0). Please refer to the new SDK Integration section of the support documentation from this point.


Remove the Legacy Receiver:

If using an overridden manifest, any legacy broadcast receiver entry must be removed from your AndroidManfiest.xml file. Failure to do so may result in crashes experienced only in production and not during development or testing.

Please ensure the following receiver has been removed from the AndroidManfiest.xml file:

<receiver android:name="com.kochava.android.tracker.ReferralCapture
        android:exported="true">
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER" />
    </intent-filter>
</receiver>

Code Changes:

Much of the public facing code implementation is nearly identical, except that the KochavaUnity namespace has been replaced directly with the Kochava class. The result is that you can simply replace any calls to KochavaUnity with Kochava. For example, KochavaUnity.Tracker.SendEvent() is now Kochava.Tracker.SendEvent(). Other behavior changes are described below.

 

IdentityLink —

This is now set using the SetIdentityLink() method anytime after initialization. If you were previously setting this within Tracker.Config you can now call SetIdentityLink() immediately after Kochava initialization.

 

Attribution Handler —

Setting an attribution handler is now easier and does not vary by platform. Use the Tracker.SetAttributionHandler() method to set your handler for any platform if needed.

 

Initialization —

If you were initializing Kochava within code (rather than using the prefab) please refer to the new SDK Integration section for detailed instructions regarding code-based integration.

 
 

Last Modified: Oct 16, 2023 at 12:24 pm