Varios problemas de AdMob
– UnityAssets3Free
hola , por aqui Daniel y aqui os traigo
esta unity pregunta
Tengo un problema con admob. Para comenzar, agregué el código de anuncio de prueba y la configuración. Aparece un pequeño banner en la parte superior, pero cuando trato de probar el intersticial, el anuncio intersticial (al hacer clic en el botón) aparece durante medio segundo y luego desaparece. He probado de todo pero no puedo hacer nada.
Aquí está el código:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using GoogleMobileAds.Api;
public class AdManager : MonoBehaviour
private BannerView bannerView;
private InterstitialAd interstitial;
[System.Obsolete]
void Start()
// Initialize the Google Mobile Ads SDK.
MobileAds.Initialize(initStatus => );
this.RequestBanner();
this.RequestInterstitial();
private void RequestBanner()
#if UNITY_ANDROID
string adUnitId = "ca-app-pub-3940256099942544~3347511713";
#elif UNITY_IPHONE
string adUnitId = "";
#else
string adUnitId = "unexpected_platform";
#endif
// Create a 320x50 banner at the top of the screen.
this.bannerView = new BannerView(adUnitId, AdSize.Banner, AdPosition.Top);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the banner with the request.
this.bannerView.LoadAd(request);
private void RequestInterstitial()
#if UNITY_ANDROID
string adUnitId = "ca-app-pub-3940256099942544~3347511713";
#elif UNITY_IPHONE
string adUnitId = "";
#else
string adUnitId = "unexpected_platform";
#endif
// Initialize an InterstitialAd.
this.interstitial = new InterstitialAd(adUnitId);
// Create an empty ad request.
AdRequest request = new AdRequest.Builder().Build();
// Load the interstitial with the request.
this.interstitial.LoadAd(request);
public void Show_InterstitialAd()
if (this.interstitial.IsLoaded())
this.interstitial.Show();
else
print("Ad is not show!");
Esta es la configuración en unity:
ingrese la descripción de la imagen aquí
ingrese la descripción de la imagen aquí
Cuando hago clic en el botón intersticial, aparecen durante 0,5 segundos y luego desaparecen. Ahora estoy probando casi todo lo que veo en youtube, pero nada funciona y como soy nuevo en esto, realmente no sé qué puedo hacer.
También otro problema, estoy tratando de probar mi aplicación en mi propio dispositivo móvil y el banner en la parte superior aparece en la unity prueba pero nada cuando instalo el apk en mi dispositivo. Agregué dispositivo de prueba a admob, nada. Intenté usar el método de agitación para mostrar el banner, nada. Esto de admob me está volviendo loco.
¡¡Necesito ayuda!!
¡¡¡Gracias!!!
1 respuesta 1
Bueno, finalmente encontré cómo resolverlo. Hay una manera de hacerlo. Si su aplicación no muestra anuncios, recuerde que debe crear un gameObject vacío y soltar el código de su solicitud de admob y mostrarlo en él. Entonces, sea cual sea el banner que desee, recuerde que debe «solicitar y cargar un anuncio» y también «mostrarlo». Google tiene un nombre en clave «helloworld» en github que tiene el rol de trabajador.
este video de youtube es lo que me ayudó:
https://youtu.be/e-q_CPfu0M0
nota: si aun no se resuelve tu pregunta por favor dejar un comentario y pronto lo podremos de nuevo , muchas gracias
eso es todo,hasta la proxima