无法从“ GoogleMobileAds.Api.InterstitialAd”转换为“字符串”

时间:2019-07-09 09:17:48

标签: c# unity3d

我遇到此错误: Assets \ Find Pairs \ Scripts \ AdsManager.cs(54,43):错误CS1503:参数1:无法从“ GoogleMobileAds.Api.InterstitialAd”转换为“ string” 使用以下代码:

python manage.py makemigrations background_task

我收到此错误: Assets \ Find Pairs \ Scripts \ AdsManager.cs(54,43):错误CS1503:参数1:无法从“ GoogleMobileAds.Api.InterstitialAd”转换为“ string”

我需要帮助

1 个答案:

答案 0 :(得分:1)

public void RequestFullScreenAd()
    {

        fullScreenAd = new InterstitialAd(fullScreenAd);

        AdRequest request = new AdRequest.Builder().Build();

        fullScreenAd.LoadAd(request);

    }

您尝试在创建新的InterstitialAd对象时将InterstitialAd对象作为字符串参数传递。它需要一个声明为fullScreenAdID的ID(字符串)。所以,

public void RequestFullScreenAd()
    {

        fullScreenAd = new InterstitialAd(fullScreenAdID);

        AdRequest request = new AdRequest.Builder().Build();

        fullScreenAd.LoadAd(request);

    }

应该工作。