Unity
Integration
Attention! Only Unity 5.4 and above is supported.
To integrate your application with devtodev system please perform the following actions:
Add the application to the Space using the wizard for adding 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 SDKs versions (1.*) 2.0, 2.0.1 or 2.0.2, you have to delete them before integrate the latest version.
To do that, delete 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 "Analytics" on 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 "My apps" → App Name → "Settings" → "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 (My apps -> App Name -> Settings -> Integration).
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 to add UserNotifications.framework as an optional library.
Additional initialization
If the application you integrate SDK in is a part of cross-platform project, then the user data initialization is required.
Since the analytics of cross-platform projects is based on an unique user (unlike the usual projects where it is based on device identifiers), you have to:
Set the 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 to 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 supposes 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 user. This identifier will we used until the real cross-platform identifier assigns to the user.
Attention! If your application allows user to relogin (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
Attention! 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