DefVideoAds (plugin for Unity ADS). Video ADS native extension

New release
DefVideoADS 3.5.0
UPDATE: UnityADS SDK updated to v3.5.0 (More info about the update on ios and on android)
ADDED: New callback type for initialization results

I keep being amazed by the ease of setup and use of extension in Defold :slight_smile:

Do you know if thereā€™s a way to play video ads in a synchronous way so that everything else stops until the ad is finished or cancelled?

Iā€™ve been getting lazy recentlyā€¦

2 Likes

Haha )
Sorry, I donā€™t know how to do that.
I think Itā€™s possible to use set_time_step to similar result.

Thanks!
Will look into using the callbacks and maybe a coroutine

Hi,
I downloaded the example Unity ads project and if I build it for android APKā€¦ I see the Unity Ads.
When I download it straight to my phone using the target IP and dmEngine.apk It fails unityads is nil ?
Is there an extra step that I am missing to get it working in this debugging mode.
Thanks.

Use debug version of your game with unity installed as target instead of dmengine.apk or your old apk (before you added DefVedeoAds).

Every time you change something in native code (for example, adding new native extension) you have to re-buld apk and then you will have acces to all namespaces you have in you new native extension.

Hi AGulev,
Thanks for your response I have learnt something new.
I didnt know that you could debug in that wayā€¦ I thought I had to use DmEngine.apk.

1 Like

The mobile dev app is documented here (incl. the limitation and workaround for projects with native extensions):

3 Likes

DefVideoAds 3.5.1

UPDATE: In order for ads to be served and measured properly with iOS14 changes coming in 2021, you will need to update to 3.5.1. Unity recently discovered a bug in the SKAdNetwork functionality in 3.4.8 and 3.5 that prohibits these versions from correctly passing SKAdNetwork.

6 Likes

The Info.plist bundled with DefVideoAds includes these SKAdNetwork types:

    <key>SKAdNetworkItems</key>
    <array>
        <dict>
            <key>SKAdNetworkIdentifier</key>
            <string>4dzt52r2t5.skadnetwork</string>
        </dict>
        <dict>
            <key>SKAdNetworkIdentifier</key>
            <string>bvpn9ufa9b.skadnetwork</string>
        </dict>
    </array>

There appear to be many, many more networks to add, all listed on UnityAds webpage. Are these additional SKAdNetwork ids used to mediate these networks within UnityAds?

If so, how can these be added with DefVideoAds? Is the only way making a copy of the plugin directory, changing the Info.plist and then removing it from dependencies?

I think itā€™s new thing. Pls create a ticket for me in repository, Iā€™ll take a look

2 Likes
3 Likes
  • UnityADS SDK updated to v3.7.1.
  • Updated plist with new SKAdNetworkIdentifier
7 Likes

Iā€™m seeing a new behaviour using Defold v1.2.182 and VideoAds v3.7.1.

On v3.5.3, after a rewarded ad has been shown, a new rewarded ad loads automatically. This doesnā€™t happen with v3.7.1, which means the game is now limited to one rewarded video per session. This happens on both Android and iOS.

Is there a way to manually load a rewarded ad after one has been shown? Or maybe there is something else in the config Iā€™m missing?

It sounds strange and Iā€™m pretty sure it works exactly the same as before.
You can check yourself: 1 and 2
There are two changes related to ads in these: 1st is ATT request, 2nd is Unity update from 3.5.3 to 3.7.1

1 Like

Iā€™m troubleshooting now. Will report back, thanks!

Update: Fixed! This is what I found:

  • The order of fired events has changed. Previously, TYPE_DID_FINISH fired before TYPE_IS_READY when a rewarded ad was shown, now it fires after.
  • In my case this change broke the flow, because I set the ā€œthere is a nice rewarded ad loadedā€ flag to false when the TYPE_DID_FINISH happened.
  • Iā€™m now setting the flag to false after TYPE_DID_START instead, which works. This is of course a much better place for it, so we can safely blame this error on my code.

Sorry for the red herring @AGulev and thanks for an amazing and well maintained extension! :star_struck:

3 Likes

Thank you!
I glad to hear that you find whatā€™s wrong.

No-no, no worries. Itā€™s fine. Feel free to reach me if you have questions.

Actually they added manual loading of an AD and itā€™s optionally with parameter in initialization method. But I didnā€™t implement the API in Lua yet. Iā€™ll try to find time and make a big refactoring of the extension in near future.

3 Likes

BREAKING CHANGE: Minimum Android SDK Version is 19
UPDATE: UnityADS SDK updated to v3.7.2
CHANGE: Use Gradle for Android SDK instead of jar file

7 Likes

Thanks for your great extension!

Iā€™ll start testing this new release today.

2 Likes

BREAKING CHANGES:

  • Lua style API with underlines (for example unityads.is_ready(placement_id) intend of unityads.isReady(placementId))
  • New callback format with message_id and message.event and better error handling

NEW:

  • New parameter enable_per_placement_load in unityads.initialize() - this parameter allows loading content for a specific Placement prior to displaying it using load(placement_id) method
  • New unityads.load(placement_id) method for loading ads manually (works only if enable_per_placement_load is true)
  • New unityads.request_idfa() method to request showing of IDFA popup on iOS before initialization of SDK. On Android it always fires callback with MSG_IDFA/EVENT_NOT_SUPPORTED

DefVideoAds was my very first native extension and itā€™s time to fully rewrite it. So, I made a massive cleanup of the extension applying all the best practices we use now. Also, I removed most of the deprecated methods under the hood and added some new Lua APIs.
These changes will help me to keep the extension up to date.

If you use an extension please pay attention to the new API methods and callback.

9 Likes