Exemple #1
0
 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));
     }
 }
Exemple #2
0
 public override void Dispose()
 {
     if (NativePtr == IntPtr.Zero)
     {
         return;
     }
     ShowListenerDestroy(NativePtr);
     NativePtr = IntPtr.Zero;
     m_UnityAdsInternalListener = null;
     m_UserListener             = null;
 }
Exemple #3
0
        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");
                }
            });
        }
Exemple #4
0
 public void Show(string placementId, IUnityAdsShowListener showListener)
 {
     UnityAdsShow(placementId, new IosShowListener(this, showListener).NativePtr);
 }
Exemple #5
0
 public IosShowListener(IUnityAdsShowListener unityAdsInternalListener, IUnityAdsShowListener userListener)
 {
     NativePtr = ShowListenerCreate(OnShowFailure, OnShowStart, OnShowClick, OnShowComplete);
     m_UnityAdsInternalListener = unityAdsInternalListener;
     m_UserListener             = userListener;
 }
Exemple #6
0
 public void Show(string placementId, IUnityAdsShowListener showListener)
 {
 }
Exemple #7
0
 public AndroidShowListener(IPlatform platform, IUnityAdsShowListener showListener) : base("com.unity3d.ads.IUnityAdsShowListener")
 {
     m_Platform        = platform;
     m_ManagedListener = showListener;
 }