AppLovin / AppLovin-MAX-Unity-Plugin

111 stars 31 forks source link

The ad click event did not call back in time #107

Open sundxing opened 2 years ago

sundxing commented 2 years ago

Unity will pause after the full-screen ad is displayed, and will not receive the event until UnityPlayerActivity returns to the foreground. We want to get all ad events in time, any solutions?

thomasmso commented 2 years ago

Hi. We're actually going to move towards the industry-standard of pausing Unity even on iOS (as right now it's only paused on Android) - that is what is most requested by clients at the moment.

sundxing commented 2 years ago

Thanks for your prompt reply @thomasmso, the behavior of pausing Unity on Android is expected, but the ad event can be called back to the child thread in some ways in real time. The result of UnitySendMessage is only triggered when UnityPlayerActivity resumes. I looked through the Unity documentation, AndroidJavaProxy may be a solution. AndroidJavaProxy-Doc, or there are some risks that I didn’t consider?

thomasmso commented 2 years ago

Agreed on the AndroidJavaProxy part - we're actually going to be using that for the ad revenue callback. But as for the other callbacks, we will consider updating it when we receive more requests.

sundxing commented 2 years ago

Ok, thanks so much

dingmingxin commented 2 years ago

Also expecting more information to be exposed in ad event callbacks 🙏 , such as ad-click-timestamp, load-impression-duration, impression-click-duration.

thomasmso commented 2 years ago

As there are numerous feature requests everyday, adding support for passing ad-click timestamp and impression click duration will depend on the requests received. But I figure if we receive enough requests, we'll just go with using AndroidJavaProxy and fire these callbacks in realtime.

Load impression duration will have an API in the next release, you will be able to track the load latency of every ad in the waterfall, and for each ad that failed to load - the reason why (from the actual mediated SDK).

dingmingxin commented 2 years ago

Thanks for the prompt reply. Whether using AndroidJavaProxy or not, more informations are expected for analyzing. By the way, AndroidJavaProxy is a better approach in my opinion.

sundxing commented 2 years ago

Hi, sorry to bother you again, another problem, i want to change Android plugin of unity to get ad events timely, but there is no source code here. I checked my project, and found iOS plugin is integrated through the source code but not the Android plugin, where to get source code of the Android plugin?

thomasmso commented 2 years ago

We distribute the Android bridge as a JAR, no plans to update to source since that would require project cleanup for backwards compatibility.

hgeg commented 11 months ago

Hello, I know it has been a while, but is there a change or improvement about this issue? OnAdDisplayedEvent for both rewarded ads and interstitials are seemingly triggered simultaneously with OnAdReceivedRewardEvent or OnAdHiddenEvent, right after the ad is disappeared. I read maybe a native android plugin can be a solution. Is there a straightforward way to trigger display events in a timely manner yet? If not is there a workaround you suggest?