• 29-09-2019, 00:44:38
    #10
    Seyit25 adlı üyeden alıntı: mesajı görüntüle
    Bu o kadar gıcık bir şeydir ki olmayınca olmaz. Arkadaşların dediği gibi en iyi çözüm sıfırdan başlamaktır. Yeni sıfır bir proje başlatın, Admob paketlerini ekleyin ve ekledikten sonra mutlaka Update ve resolver olayını yapın. Bu işlemler başarılı olmazsa projeniz çalışmayacaktır. Ayrıca kodları tekrar kontrol edin, manifest'in içine reklam id nizi eklemeyi unutmayın.
    En baştan bir projeye de ekleyip denedim fakat sonuç aynı.

    Ne yapsam bilemedim , yarın admob plugini değiştireyim fakat bir şey değişeceğini sanmıyorum...
  • 29-09-2019, 10:48:52
    #11
    Resolver numarası 1_88 olanı bulun admob unitypackagede sorun çözülcektir tahmini geçen bahardaki bir tarih Githubdan bakabilirsiniz
    Projeyi sıfırlamanıza gerek yok Plugin GoogleMobileads ve Playservices klasörlerini silin yeter
  • 29-09-2019, 12:32:03
    #12
    baymobile adlı üyeden alıntı: mesajı görüntüle
    Resolver numarası 1_88 olanı bulun admob unitypackagede sorun çözülcektir tahmini geçen bahardaki bir tarih Githubdan bakabilirsiniz
    Projeyi sıfırlamanıza gerek yok Plugin GoogleMobileads ve Playservices klasörlerini silin yeter
    Bulamadım o sürümü....



    baymobile adlı üyeden alıntı: mesajı görüntüle
    Resolver numarası 1_88 olanı bulun admob unitypackagede sorun çözülcektir tahmini geçen bahardaki bir tarih Githubdan bakabilirsiniz
    Projeyi sıfırlamanıza gerek yok Plugin GoogleMobileads ve Playservices klasörlerini silin yeter
    @Archetype;

    O sürümü bulamadım ama farklı bir sürüm indirdim,play services i de silmeden denedim şuan hata falan vermiyor fakat reklam da açılmıyor...

    Admobmanager kodlarım şu şekilde (Google admob örnek kodlarından aldım)

    EDIT : Şimdi tekrar denedim interneti açmamışım , reklam gösterildi fakat sadece banneri gördüm rewardeda tıkladım bir şey yok...

    EDIT2:Şimdide rewarded açıldı fakat tıkladığımda değil biraz geç açılıyor test olmasına rağmen birde kendi id mi koyarsam nolcak acaba...

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using GoogleMobileAds;
    using GoogleMobileAds.Api;
    using System;
    
    public class AdmobManager : MonoBehaviour
    {
    private BannerView bannerView;
    private InterstitialAd interstitial;
    private RewardedAd rewardedAd;
    private float deltaTime = 0.0f;
    private static string outputMessage = string.Empty;
    
    public static string OutputMessage
    {
    set { outputMessage = value; }
    }
    
    public void Start()
    {
    
    #if UNITY_ANDROID
    string appId = "ca-app-pub-3940256099942544~3347511713";
    #elif UNITY_IPHONE
    string appId = "ca-app-pub-3940256099942544~1458002511";
    #else
    string appId = "unexpected_platform";
    #endif
    
    MobileAds.SetiOSAppPauseOnBackground(true);
    
    // Initialize the Google Mobile Ads SDK.
    MobileAds.Initialize(appId);
    
    this.CreateAndLoadRewardedAd();
    }
    
    public void Update()
    {
    // Calculate simple moving average for time to render screen. 0.1 factor used as smoothing
    // value.
    this.deltaTime += (Time.deltaTime - this.deltaTime) * 0.1f;
    }
    
    public void OnGUI()
    {
    GUIStyle style = new GUIStyle();
    
    Rect rect = new Rect(0, 0, Screen.width, Screen.height);
    style.alignment = TextAnchor.LowerRight;
    style.fontSize = (int)(Screen.height * 0.06);
    style.normal.textColor = new Color(0.0f, 0.0f, 0.5f, 1.0f);
    float fps = 1.0f / this.deltaTime;
    string text = string.Format("{0:0.} fps", fps);
    GUI.Label(rect, text, style);
    
    // Puts some basic buttons onto the screen.
    GUI.skin.button.fontSize = (int)(0.035f * Screen.width);
    float buttonWidth = 0.35f * Screen.width;
    float buttonHeight = 0.15f * Screen.height;
    float columnOnePosition = 0.1f * Screen.width;
    float columnTwoPosition = 0.55f * Screen.width;
    
    Rect requestBannerRect = new Rect(
    columnOnePosition,
    0.05f * Screen.height,
    buttonWidth,
    buttonHeight);
    if (GUI.Button(requestBannerRect, "RequestnBanner"))
    {
    this.RequestBanner();
    }
    
    Rect destroyBannerRect = new Rect(
    columnOnePosition,
    0.225f * Screen.height,
    buttonWidth,
    buttonHeight);
    if (GUI.Button(destroyBannerRect, "DestroynBanner"))
    {
    this.bannerView.Destroy();
    }
    
    Rect requestInterstitialRect = new Rect(
    columnOnePosition,
    0.4f * Screen.height,
    buttonWidth,
    buttonHeight);
    if (GUI.Button(requestInterstitialRect, "RequestnInterstitial"))
    {
    this.RequestInterstitial();
    }
    
    Rect showInterstitialRect = new Rect(
    columnOnePosition,
    0.575f * Screen.height,
    buttonWidth,
    buttonHeight);
    if (GUI.Button(showInterstitialRect, "ShownInterstitial"))
    {
    this.ShowInterstitial();
    }
    
    Rect destroyInterstitialRect = new Rect(
    columnOnePosition,
    0.75f * Screen.height,
    buttonWidth,
    buttonHeight);
    if (GUI.Button(destroyInterstitialRect, "DestroynInterstitial"))
    {
    this.interstitial.Destroy();
    }
    
    Rect requestRewardedRect = new Rect(
    columnTwoPosition,
    0.05f * Screen.height,
    buttonWidth,
    buttonHeight);
    if (GUI.Button(requestRewardedRect, "RequestnRewarded Ad"))
    {
    this.CreateAndLoadRewardedAd();
    }
    
    Rect showRewardedRect = new Rect(
    columnTwoPosition,
    0.225f * Screen.height,
    buttonWidth,
    buttonHeight);
    if (GUI.Button(showRewardedRect, "ShownRewarded Ad"))
    {
    this.ShowRewardedAd();
    }
    
    Rect textOutputRect = new Rect(
    columnTwoPosition,
    0.925f * Screen.height,
    buttonWidth,
    0.05f * Screen.height);
    GUI.Label(textOutputRect, outputMessage);
    }
    
    // Returns an ad request with custom ad targeting.
    private AdRequest CreateAdRequest()
    {
    return new AdRequest.Builder()
    .AddTestDevice(AdRequest.TestDeviceSimulator)
    .AddTestDevice("0123456789ABCDEF0123456789ABCDEF")
    .AddKeyword("game")
    .SetGender(Gender.Male)
    .SetBirthday(new DateTime(1985, 1, 1))
    .TagForChildDirectedTreatment(false)
    .AddExtra("color_bg", "9B30FF")
    .Build();
    }
    
    private void RequestBanner()
    {
    // These ad units are configured to always serve test ads.
    #if UNITY_EDITOR
    string adUnitId = "unused";
    #elif UNITY_ANDROID
    string adUnitId = "ca-app-pub-3940256099942544/6300978111";
    #elif UNITY_IPHONE
    string adUnitId = "ca-app-pub-3940256099942544/2934735716";
    #else
    string adUnitId = "unexpected_platform";
    #endif
    
    // Clean up banner ad before creating a new one.
    if (this.bannerView != null)
    {
    this.bannerView.Destroy();
    }
    
    // Create a 320x50 banner at the top of the screen.
    this.bannerView = new BannerView(adUnitId, AdSize.SmartBanner, AdPosition.Top);
    
    // Register for ad events.
    this.bannerView.OnAdLoaded += this.HandleAdLoaded;
    this.bannerView.OnAdFailedToLoad += this.HandleAdFailedToLoad;
    this.bannerView.OnAdOpening += this.HandleAdOpened;
    this.bannerView.OnAdClosed += this.HandleAdClosed;
    this.bannerView.OnAdLeavingApplication += this.HandleAdLeftApplication;
    
    // Load a banner ad.
    this.bannerView.LoadAd(this.CreateAdRequest());
    }
    
    private void RequestInterstitial()
    {
    // These ad units are configured to always serve test ads.
    #if UNITY_EDITOR
    string adUnitId = "unused";
    #elif UNITY_ANDROID
    string adUnitId = "ca-app-pub-3940256099942544/1033173712";
    #elif UNITY_IPHONE
    string adUnitId = "ca-app-pub-3940256099942544/4411468910";
    #else
    string adUnitId = "unexpected_platform";
    #endif
    
    // Clean up interstitial ad before creating a new one.
    if (this.interstitial != null)
    {
    this.interstitial.Destroy();
    }
    
    // Create an interstitial.
    this.interstitial = new InterstitialAd(adUnitId);
    
    // Register for ad events.
    this.interstitial.OnAdLoaded += this.HandleInterstitialLoaded;
    this.interstitial.OnAdFailedToLoad += this.HandleInterstitialFailedToLoad;
    this.interstitial.OnAdOpening += this.HandleInterstitialOpened;
    this.interstitial.OnAdClosed += this.HandleInterstitialClosed;
    this.interstitial.OnAdLeavingApplication += this.HandleInterstitialLeftApplication;
    
    // Load an interstitial ad.
    this.interstitial.LoadAd(this.CreateAdRequest());
    }
    
    public void CreateAndLoadRewardedAd()
    {
    #if UNITY_EDITOR
    string adUnitId = "unused";
    #elif UNITY_ANDROID
    string adUnitId = "ca-app-pub-3940256099942544/5224354917";
    #elif UNITY_IPHONE
    string adUnitId = "ca-app-pub-3940256099942544/1712485313";
    #else
    string adUnitId = "unexpected_platform";
    #endif
    // Create new rewarded ad instance.
    this.rewardedAd = new RewardedAd(adUnitId);
    
    // Called when an ad request has successfully loaded.
    this.rewardedAd.OnAdLoaded += HandleRewardedAdLoaded;
    // Called when an ad request failed to load.
    this.rewardedAd.OnAdFailedToLoad += HandleRewardedAdFailedToLoad;
    // Called when an ad is shown.
    this.rewardedAd.OnAdOpening += HandleRewardedAdOpening;
    // Called when an ad request failed to show.
    this.rewardedAd.OnAdFailedToShow += HandleRewardedAdFailedToShow;
    // Called when the user should be rewarded for interacting with the ad.
    this.rewardedAd.OnUserEarnedReward += HandleUserEarnedReward;
    // Called when the ad is closed.
    this.rewardedAd.OnAdClosed += HandleRewardedAdClosed;
    
    // Create an empty ad request.
    AdRequest request = this.CreateAdRequest();
    // Load the rewarded ad with the request.
    this.rewardedAd.LoadAd(request);
    }
    
    private void ShowInterstitial()
    {
    if (this.interstitial.IsLoaded())
    {
    this.interstitial.Show();
    }
    else
    {
    MonoBehaviour.print("Interstitial is not ready yet");
    }
    }
    
    public void ShowRewardedAd()
    {
    if (this.rewardedAd.IsLoaded())
    {
    this.rewardedAd.Show();
    }
    else
    {
    MonoBehaviour.print("Rewarded ad is not ready yet");
    }
    }
    
    #region Banner callback handlers
    
    public void HandleAdLoaded(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleAdLoaded event received");
    }
    
    public void HandleAdFailedToLoad(object sender, AdFailedToLoadEventArgs args)
    {
    MonoBehaviour.print("HandleFailedToReceiveAd event received with message: " + args.Message);
    }
    
    public void HandleAdOpened(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleAdOpened event received");
    }
    
    public void HandleAdClosed(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleAdClosed event received");
    }
    
    public void HandleAdLeftApplication(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleAdLeftApplication event received");
    }
    
    #endregion
    
    #region Interstitial callback handlers
    
    public void HandleInterstitialLoaded(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleInterstitialLoaded event received");
    }
    
    public void HandleInterstitialFailedToLoad(object sender, AdFailedToLoadEventArgs args)
    {
    MonoBehaviour.print(
    "HandleInterstitialFailedToLoad event received with message: " + args.Message);
    }
    
    public void HandleInterstitialOpened(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleInterstitialOpened event received");
    }
    
    public void HandleInterstitialClosed(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleInterstitialClosed event received");
    }
    
    public void HandleInterstitialLeftApplication(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleInterstitialLeftApplication event received");
    }
    
    #endregion
    
    #region RewardedAd callback handlers
    
    public void HandleRewardedAdLoaded(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleRewardedAdLoaded event received");
    }
    
    public void HandleRewardedAdFailedToLoad(object sender, AdErrorEventArgs args)
    {
    MonoBehaviour.print(
    "HandleRewardedAdFailedToLoad event received with message: " + args.Message);
    }
    
    public void HandleRewardedAdOpening(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleRewardedAdOpening event received");
    }
    
    public void HandleRewardedAdFailedToShow(object sender, AdErrorEventArgs args)
    {
    MonoBehaviour.print(
    "HandleRewardedAdFailedToShow event received with message: " + args.Message);
    }
    
    public void HandleRewardedAdClosed(object sender, EventArgs args)
    {
    MonoBehaviour.print("HandleRewardedAdClosed event received");
    }
    
    public void HandleUserEarnedReward(object sender, Reward args)
    {
    string type = args.Type;
    double amount = args.Amount;
    MonoBehaviour.print(
    "HandleRewardedAdRewarded event received for "
    + amount.ToString() + " " + type);
    }
    
    #endregion
    }