Example #1
0
 public void Show()
 {
     Debug.Log("SHow add clicked");
     Debug.Log(ZoneId);
     Debug.Log(ad.adId);
     Tapsell.ShowAd(ad, ZoneId, new TapsellShowOptions());
 }
Example #2
0
    public void GetNative()
    {
        AdButton.gameObject.SetActive(false);

        _nativeAd = null;
        Tapsell.requestNativeBannerAd(this, _zoneId,
                                      (TapsellNativeBannerAd result) =>
        {
            // onRequestFilled
            _nativeAd = result;     // store this to show the ad later
            OnAdReady.Invoke();
            AdButton.gameObject.SetActive(true);
            SetAdVisual();
        },

                                      (string zoneId) =>
        {
            // onNoAdAvailable
        },

                                      (TapsellError error) =>
        {
            // onError
        },

                                      (string zoneId) =>
        {
            // onNoNetwork
        }
                                      );
    }
Example #3
0
    public void RequestAd()
    {
        Tapsell.RequestAd(this.zoneID, this.cashed,
                          (TapsellAd result) =>
        {
            // onAdAvailable

            adID = result;
        },
                          (string zone) =>
        {
            // onNoAdAvailable
        },
                          (TapsellError error) =>
        {
            // onError
            Debug.Log(error.message);
        },
                          (string zone) =>
        {
            // onNoNetwork
        },
                          (TapsellAd result) =>
        {
            // onExpiring

            adID = null;
            RequestAd();
        }
                          );
    }
Example #4
0
    public static void RequestBannerAd()
    {
#if UNITY_ANDROID
        if (Application.platform == RuntimePlatform.Android)
        {
            IsRequesting = true;
            Tapsell.RequestBannerAd(ZoneID, BannerType.BANNER_320x50, Gravity.BOTTOM, Gravity.CENTER,
                                    (string zoneId) =>
            {
                Debug.Log("on Ad Available");
                IsRequesting = false;
            },
                                    (string zoneId) =>
            {
                Debug.Log("no Ad Available");
                IsRequesting = false;
            },
                                    (TapsellError error) =>
            {
                Debug.Log(error.message);
                IsRequesting = false;
            },
                                    (string zoneId) =>
            {
                Debug.Log("no Network");
                IsRequesting = false;
            },
                                    (string zoneId) =>
            {
                Debug.Log("Hide Banner");
                IsRequesting = false;
            });
        }
#endif
    }
Example #5
0
    private void Update()
    {
        if (videoAvailable && videoAllow)
        {
            videoAvailable = false;
            videoAllow     = false;

            TapsellShowOptions options = new TapsellShowOptions();
            options.backDisabled  = false;
            options.immersiveMode = false;
            options.rotationMode  = TapsellShowOptions.ROTATION_LOCKED_LANDSCAPE;
            options.showDialog    = true;
            Tapsell.showAd(Videoad, options);
            StartCoroutine(ReqAgain(videoZoneId));
        }
        else if (bannerAvailable && bannerAllow)
        {
            bannerAvailable = false;
            bannerAllow     = false;
            TapsellShowOptions options = new TapsellShowOptions();
            options.backDisabled  = false;
            options.immersiveMode = false;
            options.rotationMode  = TapsellShowOptions.ROTATION_LOCKED_LANDSCAPE;
            options.showDialog    = true;
            Tapsell.showAd(Bannerad, options);
            StartCoroutine(ReqAgain(bannerZoneId));
        }
    }
    public void Request()
    {
        Tapsell.RequestNativeBannerAd(this, ZONE_ID,
                                      (TapsellNativeBannerAd result) => {
            // onAdAvailable
            Debug.Log("on Ad Available");
            nativeAd = result;
        },

                                      (string zoneId) => {
            // onNoAdAvailable
            Debug.Log("no Ad Available");
        },

                                      (TapsellError error) => {
            // onError
            Debug.Log(error.message);
        },

                                      (string zoneId) => {
            // onNoNetwork
            Debug.Log("no Network");
        }
                                      );
    }
Example #7
0
 private void requestAd(string zone, bool cached)
 {
     Tapsell.requestAd(zone, cached,
                       (TapsellAd result) =>
     {
         // onAdAvailable
         Debug.Log("Action: onAdAvailable");
         available = true;
         ad        = result;
     },
                       (string zoneId) =>
     {
         // onNoAdAvailable
         Debug.Log("No Ad Available");
     },
                       (TapsellError error) =>
     {
         // onError
         Debug.Log(error.error);
     },
                       (string zoneId) =>
     {
         // onNoNetwork
         Debug.Log("No Network: " + zoneId);
     },
                       (TapsellAd result) =>
     {
         //onExpiring
         Debug.Log("Expiring");
         available = false;
         ad        = null;
         requestAd(result.zoneId, false);
     }
                       );
 }
Example #8
0
    private void requestNativeBannerAd(string zone)
    {
        Tapsell.requestNativeBannerAd(this, zone,
                                      (TapsellNativeBannerAd result) => {
            // onAdAvailable
            Debug.Log("Action: onNativeRequestFilled");

            Test.nativeAd = result;
        },

                                      (string zoneId) => {
            // onNoAdAvailable
            Debug.Log("No Ad Available");
        },

                                      (TapsellError error) => {
            // onError
            Debug.Log(error.error);
        },

                                      (string zoneId) => {
            // onNoNetwork
            Debug.Log("No Network: " + zoneId);
        }
                                      );
    }
Example #9
0
    void Start()
    {
        // Use your tapsell key for initialization
        Tapsell.initialize("lcbsennldtamphdmbhbesbpchejasddgnkildqpmesmpdmbhdrkbjrcpkmnfjhqmfpbkio");

        Debug.Log("Tapsell Version: " + Tapsell.getVersion());
        Tapsell.setDebugMode(true);
        Tapsell.setPermissionHandlerConfig(Tapsell.PERMISSION_HANDLER_AUTO);

        //Tapsell.setRewardListener (
        //(TapsellAdFinishedResult result) =>
        //{
        // onFinished, you may give rewards to user if result.completed and result.rewarded are both True
        //Debug.Log ("onFinished, adId:"+result.adId+", zoneId:"+result.zoneId+", completed:"+result.completed+", rewarded:"+result.rewarded);

        // You can validate suggestion from you server by sending a request from your game server to tapsell, passing adId to validate it
        //if(result.completed && result.rewarded)
        //{
        //validateSuggestion(result.adId);
        //}
        //}
        //);

        Tapsell.requestBannerAd("5a1699df45227100012953cb", BannerType.BANNER_320x50, Gravity.BOTTOM, Gravity.CENTER);
    }
    void Start()
    {
#if Unitu_Android
        Tapsell.initialize("rjknmfmqhdfrbhedsroorjaoacnesmflnjrjreijkabfgppehssoacqqgrbdpdtsifhqet");
        AdVideoManager.gameObject.SetActive(true);
#endif
    }
Example #11
0
    // Use this for initialization
    void Start()
    {
        gm = GameObject.FindGameObjectWithTag("GameController").GetComponent <GameController>();
        Tapsell.initialize("pfngctibpmqikpksakojsqtdekhctoearehjsiphnekqibnqbockjelqdfaadrognqeiod");

        Debug.Log("Tapsell Version: " + Tapsell.getVersion());
        Tapsell.setDebugMode(true);
        Tapsell.setPermissionHandlerConfig(Tapsell.PERMISSION_HANDLER_AUTO);


        Tapsell.setRewardListener(
            (TapsellAdFinishedResult result) =>
        {
            // onFinished, you may give rewards to user if result.completed and result.rewarded are both True
            Debug.Log("onFinished, adId:" + result.adId + ", zoneId:" + result.zoneId + ", completed:" +
                      result.completed + ", rewarded:" + result.rewarded);

            // You can validate suggestion from you server by sending a request from your game server to tapsell, passing adId to validate it
            if (result.completed && result.rewarded)
            {
                validateSuggestion(result.adId);
            }
        }
            );
        requestAd("5af42da0ada66f0001c9061c", false);
    }
    public void NotifyNativeBannerFilled(String body)
    {
        TapsellNativeBannerAd result = new TapsellNativeBannerAd();

        result = JsonUtility.FromJson <TapsellNativeBannerAd> (body);
        Debug.Log("notifyNativeBannerFilled:" + result.zoneId + ":" + result.adId);
        Tapsell.OnNativeBannerFilled(result);
    }
Example #13
0
    public void NotifyBannerRequestFilled(String str)
    {
        debugLog("NotifyBannerRequestFilled:" + str);
        JSONNode node = JSON.Parse(str);
        String   zone = node ["zoneId"].Value;

        Tapsell.onBannerRequestFilled(zone);
    }
Example #14
0
    public void NotifyNoAdAvailable(String str)
    {
        debugLog("NotifyNoAdAvailable:" + str);
        JSONNode node = JSON.Parse(str);
        String   zone = node ["zoneId"].Value;

        Tapsell.onNoAdAvailable(zone);
    }
    public void NotifyShowFinished(String body)
    {
        TapsellAdFinishedResult result = new TapsellAdFinishedResult();

        result = JsonUtility.FromJson <TapsellAdFinishedResult> (body);
        Debug.Log("notifyShowFinished:" + result.zoneId + ":" + result.adId + ":" + result.rewarded);
        Tapsell.OnAdShowFinished(result);
    }
    public void NotifyClosed(String body)
    {
        TapsellAd result = new TapsellAd();

        result = JsonUtility.FromJson <TapsellAd> (body);
        Debug.Log("notifyClosed:" + result.zoneId + ":" + result.adId);
        Tapsell.OnClosed(result);
    }
    public void NotifyAdAvailable(String body)
    {
        TapsellAd result = new TapsellAd();

        result = JsonUtility.FromJson <TapsellAd> (body);
        Debug.Log("notifyAdAvailable:" + result.zoneId + ":" + result.adId);
        Tapsell.OnAdAvailable(result);
    }
    public void NotifyError(String body)
    {
        TapsellError error = new TapsellError();

        error = JsonUtility.FromJson <TapsellError> (body);
        Debug.Log("notifyError:" + error.zoneId + ":" + error.message);
        Tapsell.OnError(error);
    }
Example #19
0
    public void NotifyHideBanner(String str)
    {
        debugLog("NotifyHideBanner:" + str);
        JSONNode node = JSON.Parse(str);
        String   zone = node ["zoneId"].Value;

        Tapsell.onHideBanner(zone);
    }
Example #20
0
    public void NotifyNativeBannerNoNetwork(String str)
    {
        debugLog("NotifyNativeBannerNoNetwork:" + str);
        JSONNode node = JSON.Parse(str);
        String   zone = node ["zoneId"].Value;

        Tapsell.onNativeBannerNoNetwork(zone);
    }
Example #21
0
    public IEnumerator ShowAd()
    {
        _endShow = false;
        Tapsell.showAd(_adid, _showOptions);

        yield return(new WaitUntil(() => _endShow));

        FollowMachine.SetOutput(_completWatch ? "Rewarded": "Cancel");
    }
Example #22
0
    public static void Show()
    {
#if UNITY_ANDROID
        if (Application.platform == RuntimePlatform.Android)
        {
            Tapsell.ShowBannerAd(ZoneID);
        }
#endif
    }
Example #23
0
    public void NotifyAdAvailable(String str)
    {
        debugLog("NotifyAdAvailable:" + str);
        JSONNode      node   = JSON.Parse(str);
        TapsellResult result = new TapsellResult();

        result.adId   = node ["adId"].Value;
        result.zoneId = node ["zoneId"].Value;
        Tapsell.onAdAvailable(result);
    }
Example #24
0
    public void NotifyExpiring(String str)
    {
        debugLog("NotifyExpiring:" + str);
        JSONNode  node   = JSON.Parse(str);
        TapsellAd result = new TapsellAd();

        result.adId   = node ["adId"].Value;
        result.zoneId = node ["zoneId"].Value;
        Tapsell.onExpiring(result);
    }
Example #25
0
    // rewarded video, interstitial video/web

    public void NotifyError(String str)
    {
        debugLog("NotifyError:" + str);
        JSONNode     node   = JSON.Parse(str);
        TapsellError result = new TapsellError();

        result.error  = node ["error"].Value;
        result.zoneId = node ["zoneId"].Value;
        Tapsell.onError(result);
    }
                public TapsellRewardedAd(string zoneId) : base(zoneId)
                {
                    if (_isGlobalHandlerSet)
                    {
                        Tapsell.SetRewardListener(OnEarnedRewardGlobal);
                        _isGlobalHandlerSet = true;
                    }

                    OnEarnedRewardGlobal += OnEarnedRewardHandler;
                }
Example #27
0
        public ErrorPromise <ShowVideoFailed> ShowVideo(string zone, bool skipable)
        {
            Initialize();
            ErrorDeferred <ShowVideoFailed> deferred = new ErrorDeferred <ShowVideoFailed>();

            if (_deferred != null)
            {
                deferred.Reject(ShowVideoFailed.AlreadyShowingVideo);
                return(deferred.Promise());
            }
            _deferred   = deferred;
            _isSkipable = skipable;
            Tapsell.requestAd(zone, false,
                              result =>
            {
                Debug.Log("On ad exists");
                // onAdAvailable
                TapsellShowOptions showOptions = new TapsellShowOptions();
                showOptions.backDisabled       = false;
                showOptions.immersiveMode      = false;
                showOptions.rotationMode       = TapsellShowOptions.ROTATION_UNLOCKED;
                showOptions.showDialog         = true;
                Tapsell.showAd(result.adId, showOptions);
            },

                              zoneId =>
            {
                Debug.Log("On no ad available");
                // onNoAdAvailable
                FailedDefered(ShowVideoFailed.NoVideoAvilable);
            },

                              error =>
            {
                Debug.Log("On Error");
                // onError
                FailedDefered(ShowVideoFailed.ProviderError);
            },

                              zoneId =>
            {
                Debug.Log("On no network");
                // onNoNetwork
                FailedDefered(ShowVideoFailed.ProviderError);
            },

                              result =>
            {
                Debug.Log("On Expire");
                // onExpiring
                FailedDefered(ShowVideoFailed.ProviderError);
                // this ad is expired, you must download a new ad for this zone
            });
            return(deferred.Promise());
        }
Example #28
0
    void RequestRewardedVideo()
    {
        requestAd(RewardID, false);

        Tapsell.setRewardListener((TapsellAdFinishedResult result) =>
        {
            int coin = PlayerPrefs.GetInt("coin");
            coin    += 100;
            PlayerPrefs.SetInt("coin", coin);
        });
    }
Example #29
0
    void Start()
    {
        Tapsell.initialize("hitinfajfertkdptqjtkqrrfoqrqpignnaaqgitqcdpbcqgskbjdsladrsbddgecniiotk");
        persian = Persian;
        english = English;
        if (restart)
        {
            PlayerPrefs.DeleteAll();
        }
        else
        {
            missionController = GetComponent <MissionController>();
            DontDestroyOnLoad(gameObject);
            if (PlayerPrefs.GetInt("FirstTime") == 0)
            {
                stateData     = new StateData();
                currencyData  = new CurrencyData();
                characterData = new CharacterData();
                characterData.charcaterIds = new List <int>();
                characterData.GurdianIds   = new List <int>();
                characterData.levels       = new List <Level>();
                characterData.charcaterIds.Add(1);
                characterData.GurdianIds.Add(1);
                characterData.charcaterId = 1;
                characterData.GurdianId   = 1;
                characterData.levels.Add(new Level(1));
                SetCharacterLevel(1);
                stateData.hadBoughtFirstOffer = false;
                stateData.lvl     = 0;
                stateData.EXP     = 0;
                stateData.GoldGet = DateTime.Now;
                missionController.MakeMission();

                saveCharacter();
                saveCurrency();
                saveState();
                PlayerPrefs.SetInt("Meat", 0);
                PageName = "Entro";
                PlayerPrefs.SetString("Language", "Persian");
            }
            else
            {
                PlayerPrefs.SetInt("Meat", 1);
                LoadCharacter();
                LoadCurrency();
                LoadState();
                SetCharacterLevel(characterData.charcaterId);

                missionController.LoadMission();

                PageName = "MainMenu";
            }
        }
    }
Example #30
0
    public void ShowAdVideo()
    {
        TapsellShowOptions showOptions = new TapsellShowOptions();

        showOptions.backDisabled  = true;
        showOptions.immersiveMode = false;
        showOptions.rotationMode  = TapsellShowOptions.ROTATION_UNLOCKED;
        showOptions.showDialog    = true;

        Tapsell.showAd(_ad, showOptions);
    }