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

Thank you for the quick update! I’ll hopefully be able to test the new version later today.

1 Like

Gave this a spin now and it spits back this when bundling for Android:

/defunityads/src/java/com/agulev/defunityads/DefUnityAdsJNI.java
	Line 392: local variable placementId is accessed from within inner class; needs to be declared final
                    sendSimpleMessage(MSG_BANNER, EVENT_SDK_ERROR, "code", code,"error", errorInfo.errorMessage, "placement_id", placementId);
                                                                                                                             ^

Bundled fine for iOS though.

hm, sorry for that. This is strange I can build it without any issues (as well as CI). ppbly you use older Defold version or something like that.
Pls check the latest version

1 Like

Very probably - I’m still on 1.2.184. Thanks for looking at this so quickly, superstar!

Going to try bundling again, will report back. Update: Built like a dream. :ok_hand:

2 Likes

The latest version works great for me so far. Releasing to production, so hopefully no hidden issues.

I am 98% confident that I updated my callback function properly :smile:

2 Likes

A post was merged into an existing topic: Defold 1.2.188 has been released

Unity SDK update to version 4.0.0

Attention deprecated API methods removed

  • is_ready() - method deprecated in 3.4.0 and removed now;
  • get_placement_state() - method deprecated in 3.4.0 and removed now;
  • optional parameter enable_per_placement_load for initialize()- now it’s always true by default.
4 Likes

i think it’s something on their side because I don’t get why it tries to use GMA if I use only unity ads itself

looking for more info on it.. ..

you are looking for more info about what? I don’t get what the question is.

On Android, in landscape orientation, ads immediately rotate to portrait and then back to landscape. Do you know why this happens?
Video attached - it’s very short so you may have to watch it a few times.

I don’t know, to be honest.
Is it the same when you watch real ads (not test ads)?

Yes the same.

The next step is to check their test app to make sure it works fine before any investigations in the NE itself.

Do you mean Ad Testing for Unity Ads ?
That app is portrait and doesn’t seem to respond to device orientation

I modified the sample app within https://github.com/Unity-Technologies/unity-ads-android to be landscape, and it shows the same behaviour, so I guess this isn’t an issue.
Would be reassured if I could find another landscape game that implements Unity Ads, so I could see this ‘in the wild’.

4 Likes

It’s not very clear, but a random game, Gravity Zero on Android, does show this behaviour:

2 Likes

Can you provide some guidance or best practices on how to load ads now?

I was previously relying on the SDK automatically loading them, so they would be ready before my game wants to show them.

UPDATED QUESTION:
What is the current state of the art for loading ads? Is pre-loading still considered okay, or are game companies starting to load on-demand, show a loading status, then show the ad?

EDIT: Nevermind the issue below, I had a typo in one spot where I was checking the “is rewarded video loaded” variable…

I tried to ad some load requests after the init completion callback, but it isn’t working quite yet. Haven’t had time to log with ADB.

Unity’s documentation seems outdated.

1 Like

We’re adding DefVideoAds and are seeing a frequent crash on one type of Android phone (LG K8 2017) when ads finish. I raise it here for wider visibility as the callstack is in the engine. We’re trying to reproduce it in the sample.

# 1 pc     0x1a6f6 /system/lib/libc.so abort+59
# 2 pc     0x1a91d /system/lib/libc.so __assert2+20
# 3 pc    0x211308 ...iIGA==/lib/arm/libRarePetsDev.so _ZN10dmGraphicsL25OpenGLSetVertexBufferDataEjjPKvNS_11BufferUsageE+808
# 4 pc    0x1d9db4 ...iIGA==/lib/arm/libRarePetsDev.so _ZN12dmGameSystemL11RenderNodesEPN5dmGui5SceneEPKNS0_11RenderEntryEPKN10Vectormath3Aos7Matrix4EPKfPPKNS0_12StencilScopeEjPv+2096
# 5 pc    0x35fb58 ...iIGA==/lib/arm/libRarePetsDev.so _ZN5dmGui11RenderSceneEPNS_5SceneERKNS_17RenderSceneParamsEPv+2884
# 6 pc    0x1d6f90 ...iIGA==/lib/arm/libRarePetsDev.so _ZN12dmGameSystemL13CompGuiRenderERKN12dmGameObject22ComponentsRenderParamsE+488
# 7 pc    0x1a6154 ...iIGA==/lib/arm/libRarePetsDev.so _ZN12dmGameObject6RenderEPNS_16CollectionHandleE+308
# 8 pc    0x1d0834 ...iIGA==/lib/arm/libRarePetsDev.so _ZN12dmGameSystem25CompCollectionProxyRenderERKN12dmGameObject22ComponentsRenderParamsE+44
# 9 pc    0x1a6154 ...iIGA==/lib/arm/libRarePetsDev.so _ZN12dmGameObject6RenderEPNS_16CollectionHandleE+308
#10 pc    0x1d0834 ...iIGA==/lib/arm/libRarePetsDev.so _ZN12dmGameSystem25CompCollectionProxyRenderERKN12dmGameObject22ComponentsRenderParamsE+44
#11 pc    0x1a6154 ...iIGA==/lib/arm/libRarePetsDev.so _ZN12dmGameObject6RenderEPNS_16CollectionHandleE+308
#12 pc    0x18fd14 ...iIGA==/lib/arm/libRarePetsDev.so _ZN8dmEngine4StepEPNS_6EngineE+1588

According to the call stack you posted it’s not related to the extension at all.

1 Like