Vungle plugin failed during ios build

First, I would suggest updating to the latest Corona SDK (2731). I don’t expect it to fix it, but it is the most stable version.

Next we will need to see your code where you init vungle and where you try to show the ads.

Rob

The code is the same of old app version and in the old version work fine, i try last corona build but do not work (no video appear)

Can be a possible bug in vungle plugin???

init ads

ads = require("ads") ads.init("vungle","my\_vungle\_id", function(event) adVideoListener(event) end)

callback function

function adVideoListener(event)  if(event.type == "adEnd") then   addCoins(5)   OkDialog(this:t("COINS\_ADDED"),this:t("ADDED") .. " 5 " .. this:t("COINS"),this:t("OK"))  end  if(event.isError) then print("Failed to receive an ad!") else print("Ad received correctly!") end end

show video

ads:setCurrentProvider("vungle") if(ads.isAdAvailable()) then  ads.show("interstitial", {  isAnimated = false, isBackButtonEnabled = false }) else  print("No video available") end

@arrafaelle

Are you testing on ios 9 device? If you are, then there may be an ATS problem. I encountered the same problem and solved by adding the following lines in build.settings file under iphone -> plist

NSAppTransportSecurity = 

{

           NSAllowsArbitraryLoads = true,

},

I know this is not an ultimate solution because apple review board may reject just because of turning off the secure loading but until vungle publishes their ads through a secure network this can be tried.

Check here for detailed ATS explanation : https://coronalabs.com/blog/2015/09/17/about-app-transport-security-ats/

i test my app in ipad with ios 9.0.2.

ok now works. :slight_smile:

I was having same issue.  This fixed it.

Thank you!!

Hi,

I have the same problem: 

  • I have an old iPhone 4 stuck with iOS 7.1.2, and Vungle works without any problem.

  • On the latest iPod touch up-to-date with iOS 9.1, Vungle doesn’t work at all (I use the lastest daily build).

  • On android, no problem.

The trick “NSAllowsArbitraryLoads = true” works on iOS 9.1, but is it a “valid solution”? If no, do we have to wait for a valid fix? If yes, you should add it in the documentation then.

I am afraid to encounter some issues during Apple certification with this flag enabled.

Thanks

Yannick

NSAppTransportSecurity = 

{

           NSAllowsArbitraryLoads = true,

},

Fixed it for me. Or so I thought…

I tested my app many times. Now I receive no callback following:

ads.init(“vungle”, vungleID, AdListener) 

The listener does not fire. And when that happens I get an empty cache: ads.showCacheFiles()

and no ads showing. Previously when the listener fired ads.init was all good and the ads showed.

I appreciate you folks have it working - but does it work “always”?

NSAllowsArbitraryLoads = true worked for me for a while and now it does not. Vungle code unchanged for over a year (it’s not worth posting - there’s little to it as per the docs and reads much like arraffaele’s code).

Tested using Xcode 7.0 and Corona SDK 2731 iOS 9.1 iPad Mini 4.

https://vungle.com/blog/2015/08/28/how-to-prepare-for-ios-9/

I thought I’d give Xcode 6.4 and Corona SDK 2719 a whirl. That doesn’t work either. Unsurprising seeing as my iPad is running iOS 9.1

I would urge you to check repeatedly that Vungle is working for you with live ads. 

I tried with live ads, and indeed, it doesn’t work on iOS 9.1. It still works on my iPhone 4 with iOS 7.1.2.

This is quite urgent for me. Vungle is the only way to have video ads in our apps, so not having it working on the latest iOS is really worrying.

So I just double checked two of my apps that use Vungle… Both are working fine with the video adverts. And I tested on my iPhone 6 with iOS 9.1.

Just checking but you guys are using:

ads.init(“vungle”, vungleID, AdListener)

You replaced the VungleID with your actual ID ( a number if I remember right) and using:

NSAppTransportSecurity =
{
NSAllowsArbitraryLoads = true,
},

In the build.settings ?

I’m back on Xcode 7.0 and Corona SDK 2731 iPad Mini 4 iOS 9.1.

Here’s my Vungle code and build settings.

settings = { orientation = { default = "portrait", supported = {"portrait"} }, iphone = { plist = { NSAppTransportSecurity = { NSAllowsArbitraryLoads = true, NSExceptionDomains = { ["fbcdn.net"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, ["facebook.com"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, ["akamaihd.net"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, }, }, LSApplicationQueriesSchemes = { "fb", "fbapi20130214", "fbapi20130410", "fbapi20140410", "fbapi20140116", "fbapi20150313", "fbapi20150629", "fbauth", "fbauth2", "fb-messenger-api20140430", }, FacebookAppID = "xxxxxxxxxxxxxxx", CFBundleURLTypes = { { CFBundleURLSchemes = { "fbxxxxxxxxxxxxxxx", } } }, UIAppFonts = { "Komikax.ttf" }, UILaunchStoryboardName = "BlackScreen", UIStatusBarHidden = true, UIPrerenderedIcon = true, -- Set to false for "shine" overlay. CFBundleDisplayName = "xxxxxxxxxxxxx", 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-40@3x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, }, }, plugins = { ["CoronaProvider.ads.iads"] = { publisherId = "com.coronalabs", }, ["CoronaProvider.ads.vungle"] = { publisherId = "com.vungle", }, ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs", }, ["CoronaProvider.native.popup.activity"] = { publisherId = "com.coronalabs", }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs" }, ["plugin.adbuddiz"] = { publisherId = "com.adbuddiz" }, ["plugin.chartboost"] = { publisherId = "com.swipeware" }, }, }

local function AdListener(event) print("\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*") print("event.response = " .. tostring(event.response)) print("event.provider = " .. tostring(event.provider)) print("event.isError = " .. tostring(event.isError)) print("event.type = " .. tostring(event.type)) print("event.name = " .. tostring(event.name)) print("event.phase = " .. tostring(event.phase)) print("\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*") if event.type == "adStart" and event.isError then local function Callback() if audioOn == 1 then audio.play(click) end end native.showAlert("XXX", "Video failed to load. Please try again shortly.", {"OK"}, Callback) -- Video ad. displayed and then closed. elseif event.type == "adEnd" and not vungleAwarded then vungleAwarded = true -- Code to reward user. elseif event.type == "adView" and not vungleAwarded then -- Code to reward user. end end ads.init("iads", bundleID)--, AdListener) ads.init("vungle", vungleID, AdListener) ads.init("admob", adMobID)--, AdListener) ads:setCurrentProvider("admob") ads.load("interstitial", {appId = adMobID, testMode = adMobTestMode})

To quote my own previous post:

I would urge you to check repeatedly that Vungle is working for you with live ads. 

The trick here is to place some print statements in the listener as I have done. 

This worked for me for about 8 live ads or so:

NSAppTransportSecurity = { NSAllowsArbitraryLoads = true, },

But now it does not work at all. When it worked for the 8 or so live ads I received print statements in the Xcode console. I can’t recall exactly what the statements said but it was along the lines of “event.provider = Vungle” and other reassuring statements confirming that ads.init(“vungle”, vungleID, AdListener) succeeded.

You will know the difference between the Vungle plugin failing and a case of Vungle being out of inventory. When the plugin is working you will get some reassuring statements confirming that ads.init(“vungle”, vungleID, AdListener) succeeded. If you do not - you will never get any videos.

As a result, calling ads.showCacheFiles() in Corona SDK: https://docs.coronalabs.com/plugin/vungle/showCacheFiles.html results in (excerpted from the Xcode log):

“cache” : [

      ],
      “appId” : “xxxxxxxxx”,
      “ifa” : “xxxxxxxxx”,
      “version” : “3.2.0”
    } 

If there were ads successfully cached then there would be entries between the square brackets.

I have other ad networks that are also initialized and I started to wonder if that was the issue. I doubt it. As you can see I only use the listener for Vungle. It appears to be an ATS (Awfully Terribly Stymied!) problem. My video views per day are literally 1/10th of what they used to be these last 6 weeks or so. Ouch! :frowning:

Hopefully Vungle will chime in soon with a fix.

@henson802

I have ads.init(“vungle”, vungleID, AdListener) where vungleID is a string. vungleID is usually (but not always!) the iOS app ID.

Interesting… so these are live ads? Is your App live and published? I only ask cause I know if you are testing and not live- you need to explicitly use test on Vungle dashboard and possibly somewhere in code- or the adverts will stop after a few broadcasts.

Like I said- my app is working fine with Vungle and I am using iOS 9.1

Sorry can’t be much help, I’d try to use only Vungle (without other advertisers) if still nothing. Try to narrow down the issue- if it was a Vungle or corona issue- then my adverts wouldn’t work but I just checked and they are working fine.

I switched over to test ads - still nada. Perhaps I didn’t leave time for the live->test propagation. Still, I doubt it’s that. I still get no print from the listener that ads.init(“vungle”, vungleID, AdListener)  succeeded.

The app is live and published. I also tried another of my live apps - still nada. I know there is a problem as my Vungle video views reported in the Vungle dash have dropped significantly. I wonder if anyone else has experience this and is it a result of iOS 9 and ATS?

It’s puzzling that your app works fine. What to do…?

Perhaps I will try your suggestion of a minimal Vungle implementation with no other “distractions”.

Thanks!

I’ve managed to get Vungle videos working. I have used a different ID from the Vungle dash from an app I know to be serving Vungle ads.

Maybe I have an app with a corrupt Vungle ID? Not sure…

I’ll have to do more tests on Monday.

Has anyone managed to use Vungle in os9 without resorting to exception list?