I’m currently using a GoogleAdmob system in Unity, but it’s an issue with built apps.
In the iOS environment, it is possible to continue watching a rewarded ad after moving to the background. However, in the Android environment, there is an issue where a log indicating the ad has been skipped or terminated is displayed, and the ad ends prematurely.
public void ShowRewardedAd()
{
const string rewardMsg =
"Rewarded ad rewarded the user. Type: {0}, amount: {1}.";
if (rewardedAd != null && rewardedAd.CanShowAd())
{
rewardedAd.Show((Reward reward) =>
{
//Ad Show Log
Debug.Log(String.Format(rewardMsg, reward.Type, reward.Amount));
});
}
}
private void RegisterEventHandlers(RewardedAd ad)
{
// ad closed Log
ad.OnAdFullScreenContentClosed += () =>
{
Debug.Log("Rewarded ad full screen content closed.");
};
}
https://developers.google.com/admob/unity/rewarded?hl=ko
As for the source code, only the appId is connected to our app in the guide on the site.
When I returned from the background to the foreground, I checked through logcat that the “Ad Show” and “Ad Close” events were happening at the same time.
My biggest question is that in Unity, I understand that there is a way to check if the user is displaying the game on the screen through OnApplicationPause.
Error qdgralloc GetSize: Unrecognized pixel format: 0x38
Error Gralloc4 isSupported(1, 1, 56, 1, ...) failed with 5
Error GraphicBufferAllocator Failed to allocate (4 x 4) layerCount 1 format 56 usage b00: 5
Error AHardwareBuffer GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
Error qdgralloc GetSize: Unrecognized pixel format: 0x3b
Error Gralloc4 isSupported(1, 1, 59, 1, ...) failed with 5
Error GraphicBufferAllocator Failed to allocate (4 x 4) layerCount 1 format 59 usage b00: 5
Error AHardwareBuffer GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
Error qdgralloc GetSize: Unrecognized pixel format: 0x38
Error Gralloc4 isSupported(1, 1, 56, 1, ...) failed with 5
Error GraphicBufferAllocator Failed to allocate (4 x 4) layerCount 1 format 56 usage b00: 5
Error AHardwareBuffer GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
Error qdgralloc GetSize: Unrecognized pixel format: 0x3b
Error Gralloc4 isSupported(1, 1, 59, 1, ...) failed with 5
Error GraphicBufferAllocator Failed to allocate (4 x 4) layerCount 1 format 59 usage b00: 5
Error AHardwareBuffer GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), handle=0x0
In addition, it is displayed as the corresponding error code.
I’d like to know if the Admob system can pause ads through that feature, and I’d like to know if iOS has an automatic processing feature.