public void Show(string placementId, IUnityAdsShowListener showListener) { // If placementId is null, use explicit defaultPlacement to match native behaviour if (m_Initialized && placementId == null) { placementId = m_Configuration.defaultPlacement; } m_Platform.UnityLifecycleManager.Post(() => { if (IsReady(placementId)) { m_Platform.UnityAdsDidStart(placementId); showListener?.OnUnityAdsShowStart(placementId); m_Placeholder.Show(placementId, m_Configuration.placements[placementId]); m_PlacementMap[placementId] = false; } else { m_Platform.UnityAdsDidFinish(placementId, ShowResult.Failed); showListener?.OnUnityAdsShowFailure(placementId, UnityAdsShowError.NOT_READY, $"Placement {placementId} is not ready"); } }); }
private void OnShowFailure(string placementId, UnityAdsShowError error, string message) { m_UnityAdsInternalListener?.OnUnityAdsShowFailure(placementId, error, message); m_UserListener?.OnUnityAdsShowFailure(placementId, error, message); }
public void onUnityAdsShowFailure(string placementId, AndroidJavaObject error, string message) { m_Platform?.UnityAdsDidError(message); m_ManagedListener?.OnUnityAdsShowFailure(placementId, EnumUtilities.GetEnumFromAndroidJavaObject(error, UnityAdsShowError.UNKNOWN), message); }