#if UNITY_ANDROID
using UnityEngine;
#endif
namespace JustTrack
{
///
/// A representation of a channel.
///
public class AttributionChannel
{
private AttributionChannel(int pId, string pName, bool pIncent)
{
this.Id = pId;
this.Name = pName;
this.IsIncent = pIncent;
}
///
/// Gets the unique identifier of the channel.
///
public int Id { get; private set; }
///
/// Gets the name of the channel.
///
public string Name { get; private set; }
///
/// Gets a value indicating whether the channel is incentivized.
///
public bool IsIncent { get; private set; }
#if UNITY_ANDROID
internal static AttributionChannel FromAndroidObject(AndroidJavaObject pChannel) {
return new AttributionChannel(
pChannel.Call("getId"),
pChannel.Call("getName"),
pChannel.Call("isIncent")
);
}
#endif
#if UNITY_IOS || UNITY_WEBGL
internal static AttributionChannel CreateChannel(int pId, string pName, bool pIncent) {
return new AttributionChannel(pId, pName, pIncent);
}
#endif
#if UNITY_EDITOR
internal static AttributionChannel CreateFakeChannel(int pId, string pName, bool pIncent) {
return new AttributionChannel(pId, pName, pIncent);
}
#endif
}
}