Unity
Integration
Only Unity 5.4 and above is supported.
Please do the following to integrate your application with devtodev:
Add the application to the Space using the wizard for adding an application.
Attention! If your Unity project can be used for compilations for different platforms, you need to add the applications in devtodev for each platform. As a result, the statistics will be gained for each platform separately.
Attention! If you install SDK versions (1.*) 2.0, 2.0.1 or 2.0.2, you have to delete them before integrating the latest version.
To do that, delete the following files and catalogues:
For 1.*
Assets/DevToDev/ (the folder)
Assets/Plugins/Android/ (files android-suport-v4.jar, AndroidManifest.xml, devtodev.jar, devtodev_android_wrapper.jar, google-play-services.jar)
Assets/Plugins/iOS/ (files AccrualType.h, CustomEventParams.h, all DevToDev*.h, Gender.h, libdevtodev.a, ReceiptStatus.h, SocialNetwork.h, TimeStatus.h, TutorialState.h)
Assets/Plugins/Metro/devtodev.dll
For 2.0
Assets/devtodev (the folder)
Assets/Plugins/DevToDevOSX.bundle
After deleting, unpack devtodev.unitypackage version 2.1 and replace all the files. If you used an interface integration, you have to re-integrate SDK.
Unpack the devtodev.unitypackage into the project
There are 2 types of integration available:
In the interface.
Open the main screen of the app.
Open Window/devtodev menu, then you'll see the following window:
Switch on "Analytics" by pressing "On" button
Add AppKey and SecretKey for all the using platforms (you can select the platform by clicking on it). If you need to debug, switch logging on.
App ID and Secret key can be found in the application settings (Open "Settings" → "SDK" → "Integration").
Script with all needed parameters if SDK initialization and tracking the user session will be automatically created and added to the scene.
Using code. Add the following strings to the GameObject which will be on the scene during the whole cycle of application work:
The appId and appSecret values are unique for each app on each platform and can be found in the settings of appropriate app ("Settings" → "SDK" → "Integration").
The specificity of integration on Android platform
Add following lines at the bottom of proguard config
The specificity of integration on iOS platform
If you are planning to build an app for iOS, you need to add libz.tbd to the XCode project settings. This library is used by devtodev Unity SDK to compress data sent to devtodev servers. Also, you have to add UserNotifications.framework as an optional library.
Please add AdSupport.framework into the project for your SDK to function correctly with iOS and also add AppTrackingTransparency.framework for iOS 14.
Here’s how you can add them.
Option 1
1. Create Editor folder in the Assets folder.
2. In the Assets folder create DevToDevPostBuild.cs script. The script is below:
3. Uncomment proj.AddFrameworkToProject(projectGuid, "AppTrackingTransparency.framework", true); if necessary.
Option 2.
1. Add AdSupport.framework into the Frameworks section of the generated Unity xcodeproj project.
2. For iOS 14, also add AppTrackingTransparency.framework.
Additional initialization
If the application you integrate SDK in is a part of a cross-platform project, then the user data initialization is required.
Since the analytics of cross-platform projects is based on a unique user (unlike the usual projects where it is based on device identifiers), you have to:
Set a unique cross-platform user identifier (it will be used for cross-platform project data collection).
Actualize the user data. Mostly it is about game applications where the player has a game level as a characteristic. For such projects, you need to set the current player level.
We recommend you set the user identifier before SDK initialization, otherwise, the user identifier from the previous session will be used since the SDK initialization moment till the UserID property is set.
If your cross-platform application is supposed to be used without cross-platform authorization, don't use the UserID property or use the empty string ("") as the user identifier. SDK will assign the unique identifier to the user. This identifier will be used until the real cross-platform identifier assigns to the user.
If your application allows user to re-login (changing the user during the working session of application), then the UserID property and CurrentLevel method should be called just after the authorization. You don't need to call the SDK initialization one more time.
Debug mode
To enable the debug mode and make SDK notifications displayed in the console use this method:
Collecting data about the amount of sessions and their length
The data about the amount of sessions and their length is collected automatically by default.
In case you want to control the beginning and the end of a session manually, use the methods below:
For the start of the session use the StartSession method:
For the end of the session use the EndSession method:
Delivering your application to the Mac App Store
Read an article and make sure you follow all the recommendations.
Delete a meta file from DevToDevOSX.bundle:
Rename CFBundleIdentifier in Info.plist inside the devtodev plugin, for example:
Sign the DevToDevOSX.bundle with the .entitlements you created earlier. To do this, type the following into the macOS Terminal:
Last updated