TouchyTickets/Android/AndroidAnalytics.cs
2020-06-05 16:14:10 +02:00

26 lines
No EOL
834 B
C#

using System.Collections;
using System.Collections.Generic;
using Android.App;
using GameAnalyticsSDK;
using GameAnalyticsSDK.Utilities;
using TouchyTickets;
namespace Android {
public class AndroidAnalytics : Analytics {
private readonly Activity activity;
public AndroidAnalytics(Activity activity) {
this.activity = activity;
}
public override void Setup(Dictionary<string, object> json) {
GameAnalytics.Initialize(this.activity, GA_MiniJSON.JsonEncode(new Hashtable(json)));
}
public override void AddResourceEvent(bool sink, string currency, float amount, string itemType, string itemId) {
GameAnalytics.NewResourceEvent(sink ? GAResourceFlowType.Sink : GAResourceFlowType.Source, currency, amount, itemType, itemId);
}
}
}