Corona sdk build.settings

591 Views Asked by At

I am trying to integrate AdMob , Revmob and vungle but I don't know if I put in the proper code in my build.settings . I don't want to use them all on one page but at different scenes . Any Help ?

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",
            "[email protected]",
            "Icon-60.png",
            "[email protected]",
            "[email protected]",
            "Icon-72.png",
            "[email protected]",
            "Icon-76.png",
            "[email protected]",
            "Icon-Small.png",
            "[email protected]",
            "[email protected]",
            "Icon-Small-40.png",
            "[email protected]",
            "Icon-Small-50.png",
            "[email protected]",
        },

        --[[
        -- 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 },
},
},
}
2

There are 2 best solutions below

0
JLONG On

For Vungle here is the Documentation

For Revmob here is the Documentation

For AdMob here is the Documentation

Now adding it on the Build.Settingsis like this:

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 }
        },

    }

}

Also take note of the permissions you need to provide on Android Devices in your androidsection

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

if you are using iOS too. Take note of the App Transport Security (ATS) for RevMob you should add this in your Build.Settings

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

As for your question in using them on different page, you can initialize each of the ads and switch ad provider by using setCurrentProvider Documentation And also there is a tutorial for multiple ad networks, you can view it here

0
kawabungajohn On

should look like this

 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 },