Created
December 25, 2020 11:56
-
-
Save melikeeroglu/a60d31e5669545f0ee0f54e9e1881d3b to your computer and use it in GitHub Desktop.
analyticswithevent
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AndroidJavaClass jc = new AndroidJavaClass("com.unity3d.player.UnityPlayer"); | |
AndroidJavaObject activity = jc.GetStatic<AndroidJavaObject>("currentActivity"); | |
HiAnalyticsTools.EnableLog(); | |
HiAnalyticsInstance instance = HiAnalytics.GetInstance(activity); | |
instance.SetAnalyticsEnabled(true); | |
Bundle bundleUnity = new Bundle(); | |
bundleUnity.PutString("id", "123456"); | |
instance.OnEvent("myFirstEvent", bundleUnity); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment