0

我正在尝试集成 AdMob 、 Revmob 和 vungle ,但我不知道我是否在 build.settings 中输入了正确的代码。我不想在一页上使用它们,而是在不同的场景中使用它们。任何帮助?

构建设置

settings =
 {

    orientation =
   {
    -- Supported values for orientation:
    -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight

    default = "portrait",
    supported = { "portrait", }
    },

   excludeFiles =
   {
    -- Include only the necessary icon files on each platform
    iphone = { "Icon-*dpi.png", },
    android = { "Icon.png", "Icon-Small-*.png", "Icon*@2x.png", },
   },

  --
   -- iOS Section
   --
  iphone =
  {
    plist =
    {
        UIStatusBarHidden = false,
        UIPrerenderedIcon = true, -- set to false for "shine" overlay
        --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend

        CFBundleIconFiles =
        {
            "Icon.png",
            "Icon@2x.png",
            "Icon-60.png",
            "Icon-60@2x.png",
            "Icon-60@3x.png",
            "Icon-72.png",
            "Icon-72@2x.png",
            "Icon-76.png",
            "Icon-76@2x.png",
            "Icon-Small.png",
            "Icon-Small@2x.png",
            "Icon-Small@3x.png",
            "Icon-Small-40.png",
            "Icon-Small-40@2x.png",
            "Icon-Small-50.png",
            "Icon-Small-50@2x.png",
        },

        --[[
        -- iOS app URL schemes:
        CFBundleURLTypes =
        {
            {
                CFBundleURLSchemes =
                {
                    "fbXXXXXXXXX",  -- replace XXXXXXXXX with your Facebook appId
                }
            }
        }
        --]]
    }
},


plugins =
{
["CoronaProvider.ads.vungle"] =
{
  publisherId = "com.vungle",
},
["CoronaProvider.ads.revmob"] =
{
  publisherId = "com.coronalabs",
  supportedPlatforms = { android = true },
},
["CoronaProvider.ads.admob"] =
{
  publisherId = "com.coronalabs",
  supportedPlatforms = { android = true },
},
},
}
4

2 回答 2

0

对于Vungle,这里是文档

对于Revmob,这里是文档

对于AdMob,这里是文档

现在添加它Build.Settings是这样的:

settings=
{

    -- Your Previous code here

    plugins =
    {

        --For RevMob
        ["plugin.revmob"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true, android=true }
        },

        --For Vungle
        ["CoronaProvider.ads.vungle"] =
        {
            publisherId = "com.vungle"
        },

        --For AdMob
        ["plugin.google.play.services"] =
        {
            publisherId = "com.coronalabs",
            supportedPlatforms = { iphone=true, android=true }
        },

    }

}

另请注意permissions您需要在您的部分中的Android 设备上提供的信息android

android =
{
    usesPermissions =
    {
        "android.permission.INTERNET",
    },
},

如果你也在使用 iOS。记下App Transport Security (ATS)对于RevMob,您应该将其添加到您的Build.Settings

iphone =
{
    plist =
    {
        NSAppTransportSecurity = { NSAllowsArbitraryLoads=true },
    },
},

至于您在不同页面上使用它们的问题,您可以使用文档初始化每个广告并切换广告提供商并且还有一个针对多个广告网络的教程,您可以查看它heresetCurrentProvider

于 2016-04-26T03:22:43.620 回答
0

应该是这样的

 pplugins =
{
   ["CoronaProvider.ads.vungle"] =
   {
      publisherId = "com.vungle",
   },
   ["CoronaProvider.ads.revmob"] =
   {
      publisherId = "com.coronalabs",
      supportedPlatforms = { android = true },
   },
   ["CoronaProvider.ads.admob"] =
   {
      publisherId = "com.coronalabs",
      supportedPlatforms = { android = true },
于 2016-04-26T16:40:13.260 回答