I noticed that the events of rewarded ads in ironSource are not divided into “before” and “after”, but are called immediately by the group after the ad is closed. Is this the expected behavior? I didn’t find any information in the ironSource documentation or anywhere else.
Just tested it for you with the Next Environment:
- Samsung Galaxy A71, Android 13
- Unity 2022.3.42
- ironSource SDK 8.2.1.
- App: AR Masker
The process is divided into 2 parts:
1:
ADS: Showing Rewarded Ad - OK
ADS: OnApplicationPause = True
2:
ADS: OnApplicationPause = False
ADS: OPENED Rewarded Video Ad:
ADS: REWARDED Rewarded
ADS: CLOSED Rewarded Ad
- Part is shown after clicking the button to see rewarded ad.
- Part is called as “group” as you say after closing the ad.
I guess this is expected behavior due to pausing.
Yes. This is quite logical from the technical side, but not expected from the point of view of use. In fact, it makes no sense to call both onAdUnavailableEvent
and onAdAvailableEvent
immediately after closing the ad. I was confused by the fact that no events are triggered before I lose focus.
I found this here:
If you want to execute tasks while it’s in background, you need to implement the background service.
Never used that.
Yes, I’ve come across this. In general, I understood the reason for this behavior. ironSource has an IronSourceEventsDispatcher that is responsible for throwing events. In fact, this is a thread-safe queue that accepts Action
as input, and then calls each frame if available. This is where the problem arises, the Dispatcher is inherited from MonoBehaviour, and when an advertisement is launched, it simply does not have time to throw the event, as focus is lost.