﻿#if UNITY_ANDROID

namespace Stove.StoveSDK
{
    using System.Collections.Generic;
    using UnityEngine;

    public class ViewInterface
    {
        static AndroidJavaObject wrapper = new AndroidJavaObject("com.stove.unity.ViewWrapper");

        public static void FetchPopup(string identifier)
        {
            wrapper.CallStatic("fetchPopup", identifier);
        }

        public static void FetchPopup(int location, string identifier)
        {
            wrapper.CallStatic("fetchPopup", location, identifier);
        }

        public static void FetchNews(string identifier)
        {
            wrapper.CallStatic("fetchNews", identifier);
        }

        public static void UseCoupon(string code, string identifier)
        {
            wrapper.CallStatic("useCoupon", code, identifier);
        }

        public static void News(string identifier)
        {
            wrapper.CallStatic("news", identifier);
        }

        public static void CustomerSupport(string identifier)
        {
            wrapper.CallStatic("customerSupport", identifier);
        }

        public static void Coupon(string identifier)
        {
            wrapper.CallStatic("coupon", identifier);
        }

        public static void Popup(string identifier)
        {
            wrapper.CallStatic("popup", identifier);
        }

        public static void Popup(int location, string identifier)
        {
            wrapper.CallStatic("popup", location, identifier);
        }

        public static void Community(string identifier)
        {
            wrapper.CallStatic("community", identifier);
        }
        
        public static void Community(string url, string identifier)
        {
            wrapper.CallStatic("communityWithURL", url, identifier);
        }

        public static void Load(string viewRequest, string identifier)
        {
            wrapper.CallStatic("load", viewRequest, identifier);
        }

        public static void OpenExternalUrl(string redirectUrl, string identifier)
        {
            wrapper.CallStatic("openExternalUrl", redirectUrl, identifier);
        }

        public static string GetVersion()
        {
            return wrapper.CallStatic<string>("getVersion");
        }
    }
}

#endif
