It’s not a secret that integration of 3rd party SDKs into Defold project is a pain, because 3rd party services don’t make adapters as they do for Unity or other lucky engines. Especially if it’s about Ads SDKs. There are few ready-to-use extensions like UnityAds and AdMob (is there any for Facebook Ads?), but first - you need to implement each one separately, second - if you want to add any other SDK like Applovin, Vungle, Facebook, Ironsource etc, you need to write a native extension. For me it’s the most avoided type of work, don’t want even thinking about it
And like a savior coming down from heaven the Enhance service has come to my attention. Saying short - you implement only core high-level calls to their SDK, make a build, upload it to their servers and they give you back a new build with all 3rd party SDKs baked into - Ads, Analytics, Tracking, whatever you’ve chosen. Sounds like a miracle!
So I’ve tried it for Ads and faced a pretty poor and ambiguous documentation. I’ve finally make it show me test ads for Facebook, Unity, AppLovin and Admob (but failed to make Vungle to work) on iOS and want to share some things I tripped over:
- One of the first steps is adding a certificate. It’s not said, what type of certificate they want for iOS build - it should be a *.p12 cert
- Enhance is going to sign the build for you, so should it be unsigned build (there is such option in Defold build settings for iOS)? If so, where to upload a mobileprovision file? - no, just make your dev build as usual, signed, Enhance will simply re-sign it with the provided *.p12 cert and so the mobileprovision will also be there
- [FIXED] Usually there are two ways to implement extension in Defold - point to Git repo in project settings or simply copy-paste sources into the project root. Enhance adapter for Defold also supports both ways, but Git version is outdated! So download the “DragAndDrop Library” as they call it, provided during integration steps.
- Ok, before implementing 3rd party SDKs the first thing you probably want to try is the in-house “Enhance Ads”. Well, I failed to get any impressions from it, and failed to find any kind of “test ads” config. So let’s just assume that it probably works, but can’t be tested.
- To test Facebook Ads you need to register Test devices by IDFA in FB Ads dashboard, otherwise there is no “fill” for you (despite the fact that you set test mode in app settings)
- To test ads with networks marked “GDPR ready” and “requires explicit opt-in” you first need to set GDPR opt-in, otherwise all requests for ads will return “not ready” (moreover, there will be no real requests for ads as I understand). This was freaking not obvious and not clearly covered in the docs, everything you got - “ad is not ready”
- I’m not sure if there is a callback for Enhance adapter initialization event, but for sure (a) it’s not synchronous (b) if you call GDPR opt-in method before initialization has finished, it’ll silently fail. So I’m just calling enhance.requiresDataConsentOptIn(callback) after each level and deal with GDPR if parameter in callback is == 1.
- There are some undocumented methods, which you can find in
enhance_extension/src/enhance.cppModule_methods const. But I’m not sure if they work and how.
- There is no callback to track when interstitial ad was closed, you might need it to mute/unmute sounds when show/close the ad, but you can’t currently.
And all this is said regarding “my own mediation” case, so, using Enhance’s simple waterfall for Ads mediation. Don’t know what new surprises you might find with other mediation options.
But at least it seems working for Interstitial ads from FB, Admob, Unity and Applovin. I wrote a message to their support regarding issues with Vungle and going to try Rewarded Ads integration next. Stay tuned
UPD1: Rewarded ads work for all listed networks including Vungle
UPD2: Vungle ads SDK should be updated soon and issue with git version of extension should be also fixed