public void Show(string placementId, IUnityAdsShowListener showListener) { if (placementId == null) { m_UnityAds?.CallStatic("show", m_CurrentActivity, new AndroidShowListener(m_Platform, showListener)); } else { m_UnityAds?.CallStatic("show", m_CurrentActivity, placementId, new AndroidShowListener(m_Platform, showListener)); } }
public override void Dispose() { if (NativePtr == IntPtr.Zero) { return; } ShowListenerDestroy(NativePtr); NativePtr = IntPtr.Zero; m_UnityAdsInternalListener = null; m_UserListener = null; }
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"); } }); }
public void Show(string placementId, IUnityAdsShowListener showListener) { UnityAdsShow(placementId, new IosShowListener(this, showListener).NativePtr); }
public IosShowListener(IUnityAdsShowListener unityAdsInternalListener, IUnityAdsShowListener userListener) { NativePtr = ShowListenerCreate(OnShowFailure, OnShowStart, OnShowClick, OnShowComplete); m_UnityAdsInternalListener = unityAdsInternalListener; m_UserListener = userListener; }
public void Show(string placementId, IUnityAdsShowListener showListener) { }
public AndroidShowListener(IPlatform platform, IUnityAdsShowListener showListener) : base("com.unity3d.ads.IUnityAdsShowListener") { m_Platform = platform; m_ManagedListener = showListener; }