Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.

Commit 524a9c7

Browse files
committed
6.0.0 - Update for Android SDK 6.0.2, iOS SDK 6.0.3
1 parent 633125c commit 524a9c7

31 files changed

Lines changed: 828 additions & 3426 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@
2525

2626
# Unity3D Generated File On Crash Reports
2727
sysinfo.txt
28+
29+
sample/.vs/*

README.md

Lines changed: 108 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,119 @@
1-
# TUNE Unity Plugin v5.0.0
1+
# TUNE Unity Plugin v6.0.0
22

3-
Includes:
4-
* TUNE Android SDK 5.0.2
5-
* TUNE iOS SDK 5.0.2
3+
The TUNE plugin for Unity provides application session and event logging functionality via the TUNE native SDKs.
64

7-
## Usage
5+
* TUNE Android SDK 6.0.2
6+
* TUNE iOS SDK 6.0.3
87

9-
This plugin was last built and tested with Unity version 2017.3.0f3.
8+
This plugin was built and tested with `Unity version 2017.4.15f1 LTS`.
109

11-
Please see the Quick Start guide here:
10+
## Dependencies
1211

13-
[Unity Quick Start](https://developers.tune.com/sdk/unity-quick-start/)
12+
Unity 2017+
1413

15-
## Sample
14+
[Google Unity Jar Resolver](https://github.com/googlesamples/unity-jar-resolver). This plugin handles Android and iOS dependency management for the TUNE plugin.
1615

17-
Open **/sample/Assets/Tune/Scenes/TUNESampleScene.unity** in Unity.
16+
For iOS builds:
17+
18+
* Xcode
19+
* [Cocoapods](https://cocoapods.org/)
20+
21+
For Android builds:
22+
23+
* Android Studio
24+
25+
## Install Tune Unity Plugin
26+
27+
Download `Tune.unitypackage` from the releases section.
28+
29+
While your Unity project is open, double click the unitypackage. It should install. Otherwise, you can import it via the menu, `Assets` -> `Import Package` -> `Custom Package`.
30+
31+
![Import Tune plugin](/images/ImportTune.png)
32+
33+
Create a new Tune script and attach it to an object.
34+
35+
```
36+
using System.Collections;
37+
using System.Collections.Generic;
38+
using UnityEngine;
39+
using TuneSDK;
40+
41+
public class TuneScript : MonoBehaviour {
42+
43+
private void Awake()
44+
{
45+
// verbose debug messages
46+
//Tune.SetDebugMode(true);
47+
48+
Tune.Init("your_advertiser_id", "your_conversion_key");
49+
Tune.MeasureSession();
50+
}
51+
52+
private void OnApplicationPause(bool pause)
53+
{
54+
if (!pause) {
55+
Tune.MeasureSession();
56+
}
57+
}
58+
59+
// Use this for initialization
60+
void Start () {
61+
62+
}
63+
64+
// Update is called once per frame
65+
void Update () {
66+
67+
}
68+
}
69+
```
70+
71+
Sample script in an example project:
72+
73+
![Sample script in Assets](/images/TuneScriptInAssets.png)
74+
75+
Sample script attached to an object:
76+
77+
![Sample script attached to an Object](/images/TuneScriptAttachedToCube.png)
78+
79+
## Build and export project
1880

1981
Switch platform to **Android** or **iOS**. Go into **Player Settings** and change the default Android package name or iOS bundle identifier to something other than `com.Company.ProductName`.
2082

21-
Then select **Build and Run**.
83+
Sample Android build settings:
84+
85+
![Sample build for Android](/images/BuildMenu.png)
86+
87+
Sample Android package name change:
88+
89+
![Sample change package name](/images/ChangingPackageName.png)
90+
91+
For Android, Unity will export an apk file.
92+
93+
For iOS, Unity will export a folder with all the project files.
94+
95+
## Running Android
96+
97+
From a terminal, use `adb install` to install the apk file to a device.
98+
99+
[adb documentation](https://developer.android.com/studio/command-line/adb)
100+
101+
If you enabled debug, you can see Tune calls in the logs by using `adb logcat`.
102+
103+
## Running iOS
104+
105+
Find and open the `Unity-iPhone.xcworkspace` file.
106+
107+
In the `Unity-iPhone` target, set the Apple developer to your developer account.
108+
109+
![Set Apple developer](/images/SetAppleDeveloper.png)
110+
111+
Debug on a device. Unity projects do not support simulator.
112+
113+
## Using the bundled Sample App
114+
115+
Open **/sample/Assets/Tune/Scenes/TUNESampleScene.unity** in Unity.
116+
117+
Build and export as you would your own project. The TUNE sample app displays a menu that uses the TUNE Unity plugin's various functionalities. To see samples of how to use the plugin in your own code, see [our sample script](sdk-unity/sample/Assets/Tune/Scripts/TuneSample.cs).
118+
22119

23-
This will run the TUNE sample app and display a menu that uses the TUNE Unity plugin's various functionalities. To see samples of how to use the plugin in your own code, see [our sample script](sdk-unity/sample/Assets/Tune/Scripts/TuneSample.cs).

Tune.unitypackage

-16.7 KB
Binary file not shown.

images/BuildMenu.png

67.4 KB
Loading

images/ChangingPackageName.png

255 KB
Loading

images/ImportTune.png

83.7 KB
Loading

images/SetAppleDeveloper.png

181 KB
Loading
196 KB
Loading

images/TuneScriptInAssets.png

193 KB
Loading
Binary file not shown.

0 commit comments

Comments
 (0)