AppLovin / AppLovin-MAX-Unity-Plugin

126 stars 34 forks source link

Placement Problem #20

Closed orhnzsy closed 4 years ago

orhnzsy commented 4 years ago

We are using enums for placements. But we are seeing one placement is empty in dashboard, and there is so many request with that.I think some ad requests (with placements) calling with null placements. or shown as null in dashboard. Is can be sdk issue? I am asking because i don't know what is the problem. Enums can not be null in c# language. Thank you for help. We don't use ad requests in editor. by the way.

thomasmso commented 4 years ago

Hey @orhnzsy - Do you mind sharing integration code on the enum definition and how it's being passed into our APIs?

orhnzsy commented 4 years ago

This is our show ad function we are sending an enum into this function then we are converting this enum with ToString function for sending to placements.

` public void ShowPlacement(Placements placementType, System.Action result) {

        if (Application.isEditor)
        {
            if (result != null)
            {
                Timing.RunCoroutine(CallVideoResultCo(result));
                Debug.LogError("DO NOT FORGET TO TEST IN MOBILE");
            }
            //Debug.LogWarning("Ads are not avaible in editor.");
            return;
        }

//#if (UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR MaxSdk.SetMuted(false); AdTypes adType = GetAdType(placementType); switch (adType) { case AdTypes.RewardedVideo: EventManager.Send(EventRewardedVideoClick.Create(placementType)); _rewardedVideoResult = result; if (MaxSdk.IsRewardedAdReady(EXPENSIVE_rewardedAdUnitId)) { Debug.Log("Placement Type: " + placementType.ToString()); MaxSdk.ShowRewardedAd(EXPENSIVE_rewardedAdUnitId, placementType.ToString()); } else if (MaxSdk.IsRewardedAdReady(rewardedAdUnitId)) { Debug.Log("Placement Type: " + placementType.ToString()); MaxSdk.ShowRewardedAd(rewardedAdUnitId, placementType.ToString()); } else { LoadRewardedAd(); Debug.LogError("no rewarded video avaible"); } break; case AdTypes.Interstitial: EventManager.Send(EventShowInterstitial.Create()); if (MaxSdk.IsInterstitialReady(interstitialAdUnitId)) { MaxSdk.ShowInterstitial(interstitialAdUnitId, placementType.ToString()); } else { LoadInterstitial(); Debug.LogError("no interstitial avaible"); }

                break;
            default:
                break;
        }

//#endif }`

orhnzsy commented 4 years ago

Placements are enums like this public enum Placements { FreeChest,// DoubleRewards, MissionSkip, MissionDoubleReward,// GameEndFullScreen, FreeRewards,// MatchLimit,// GameEndSpin,// WeaponRent,// CardGame,// WeaponUpgradeOfferRewarded,// ArmorUpgradeOfferRewarded, NONE }

orhnzsy commented 4 years ago

This is our init function when sdk initialization finished, we are registering callbacks for ads then start loading ads for initting

public void InitAgent() { InitInterstitial(); MaxSdkCallbacks.OnSdkInitializedEvent += (MaxSdkBase.SdkConfiguration sdkConfiguration) => { // AppLovin SDK is initialized, start loading ads OnSDKInitialized(); }; MaxSdk.SetSdkKey("sdk-key"); MaxSdk.InitializeSdk(); }

orhnzsy commented 4 years ago

Can you explain exactly what should I put in the account details? @angelwu0409 Thank you.

angelwu0409 commented 4 years ago

Hi @orhnzsy, Sorry about the late reply! We just need your account email, the application that is having the issues and that should be enough to start :).

thomasmso commented 4 years ago

@orhnzsy - Has the issue been resolved?

orhnzsy commented 4 years ago

@thomasmso yes issue has been resolved but i don't know what was the problem, the null placement is gone.