Пример #1
0
 private void MaxSDKInterstitialHidden(string adUnitId)
 {
     client.OnInterstitialHiddenEvent();
 }
Пример #2
0
            void onAppLovinEventReceived(string ev)
            {
                // Banner
                if (ev.Contains("LOADEDBANNER"))
                {
                    adClient.OnBannerLoadedEvent(true);
                }
                else if (ev.Contains("LOADBANNERFAILED"))
                {
                    adClient.OnBannerLoadedEvent(false);
                }
                else if (ev.Contains("DISPLAYEDBANNER"))
                {
                    adClient.OnBannerDisplayedEvent();
                }

                // Interstitial

                if (ev.Contains("DISPLAYEDINTER"))
                {
                    adClient.OnInterstitialDisplayedEvent();
                }
                else if (ev.Contains("HIDDENINTER"))
                {
                    adClient.OnInterstitialHiddenEvent();
                }
                else if (ev.Contains("LOADEDINTER"))
                {
                    adClient.OnInterstitialLoadedEvent(true);
                }
                else if (string.Equals(ev, "LOADINTERFAILED"))
                {
                    adClient.OnInterstitialLoadedEvent(false);
                }

                // Rewarded

                if (ev.Contains("REWARDAPPROVEDINFO"))
                {
                    // The format would be "REWARDAPPROVEDINFO|AMOUNT|CURRENCY" so "REWARDAPPROVEDINFO|10|Coins" for example
                    char delimeter = '|';

                    string[] split = ev.Split(delimeter);

                    double amount = double.Parse(split[1]);

                    string currencyName = split[2];

                    adClient.OnRewardedCompletedEvent(amount, currencyName);
                }
                else if (ev.Contains("LOADEDREWARDED"))
                {
                    adClient.OnRewardedLoadedEvent(true);
                }
                else if (ev.Contains("LOADREWARDEDFAILED"))
                {
                    adClient.OnRewardedLoadedEvent(false);
                }
                else if (ev.Contains("DISPLAYEDREWARDED"))
                {
                    adClient.OnRewardedDisplayedEvent();
                }
                else if (ev.Contains("HIDDENREWARDED"))
                {
                    adClient.OnRewardedHiddenEvent();
                }
                else if (ev.Contains("USERCLOSEDEARLY"))
                {
                    adClient.OnRewardedCanceledEvent();
                }

                // Ad clicked
                if (ev.Contains("CLICKED"))
                {
                    adClient.OnAdClicked();
                }
            }