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

Commit

Permalink
Always use native init to get instance
Browse files Browse the repository at this point in the history
  • Loading branch information
John Gu committed Apr 15, 2016
1 parent 5840a6f commit 62bf008
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# TUNE Unity Plugin v4.0.0
# TUNE Unity Plugin v4.0.1

Includes:
* TUNE Android SDK 4.0.3
Expand Down
Binary file modified Tune.unitypackage
Binary file not shown.
15 changes: 4 additions & 11 deletions sample/Assets/Tune/Scripts/TuneAndroid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class TuneAndroid

private TuneAndroid()
{
ajcInstance = ajcTune.CallStatic<AndroidJavaObject>("getInstance");
ajcCurrentActivity = ajcUnityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
}

Expand All @@ -42,11 +41,8 @@ public static TuneAndroid Instance
/// </summary>
public void Init(string advertiserId, string conversionKey)
{
if (ajcInstance == null)
{
ajcInstance = ajcTune.CallStatic<AndroidJavaObject>("init", ajcCurrentActivity, advertiserId, conversionKey);
ajcInstance.Call("setPluginName", "unity");
}
ajcInstance = ajcTune.CallStatic<AndroidJavaObject>("init", ajcCurrentActivity, advertiserId, conversionKey);
ajcInstance.Call("setPluginName", "unity");
}

/// <summary>
Expand All @@ -55,11 +51,8 @@ public void Init(string advertiserId, string conversionKey)
/// </summary>
public void Init(string advertiserId, string conversionKey, bool turnOnTMA)
{
if (ajcInstance == null)
{
ajcInstance = ajcTune.CallStatic<AndroidJavaObject>("init", ajcCurrentActivity, advertiserId, conversionKey, turnOnTMA);
ajcInstance.Call("setPluginName", "unity");
}
ajcInstance = ajcTune.CallStatic<AndroidJavaObject>("init", ajcCurrentActivity, advertiserId, conversionKey, turnOnTMA);
ajcInstance.Call("setPluginName", "unity");
}

public void MeasureSession()
Expand Down

0 comments on commit 62bf008

Please sign in to comment.