public void Load(string placementId, IUnityAdsLoadListener loadListener) { // If placementId is null, use explicit defaultPlacement to match native behaviour if (m_Initialized && placementId == null) { placementId = m_Configuration.defaultPlacement; } if (!m_Initialized) { m_QueuedLoads?.Enqueue(placementId); return; } m_Platform.UnityLifecycleManager.Post(() => { if (m_PlacementMap.ContainsKey(placementId)) { m_PlacementMap[placementId] = true; m_Platform.UnityAdsReady(placementId); loadListener?.OnUnityAdsAdLoaded(placementId); } else { string errorMessage = "Placement " + placementId + " does not exist for gameId: " + m_GameId; m_Platform.UnityAdsDidError(errorMessage); loadListener?.OnUnityAdsFailedToLoad(placementId, UnityAdsLoadError.INVALID_ARGUMENT, errorMessage); } }); }
public void onUnityAdsFailedToLoad(string placementId, AndroidJavaObject error, string message) { m_Platform?.UnityAdsDidError($"Failed to load placement: {placementId}"); m_ManagedListener?.OnUnityAdsFailedToLoad(placementId, EnumUtilities.GetEnumFromAndroidJavaObject(error, UnityAdsLoadError.UNKNOWN), message); }
private void OnLoadFailure(string placementId, UnityAdsLoadError error, string message) { m_UnityAdsInternalListener?.OnUnityAdsFailedToLoad(placementId, error, message); m_UserListener?.OnUnityAdsFailedToLoad(placementId, error, message); }