10.4 C
Canberra
Friday, September 20, 2024

android – Google Admob – Whereas watching a rewarded advert, when the app strikes to the background after which returns to the foreground, the advert is forcibly skipped


I am at the moment utilizing a GoogleAdmob system in Unity, however it’s a difficulty with constructed apps.

Within the iOS atmosphere, it’s potential to proceed watching a rewarded advert after shifting to the background. Nevertheless, within the Android atmosphere, there is a matter the place a log indicating the advert has been skipped or terminated is displayed, and the advert ends prematurely.

public void ShowRewardedAd()
{
    const string rewardMsg =
        "Rewarded advert rewarded the consumer. Kind: {0}, quantity: {1}.";

    if (rewardedAd != null && rewardedAd.CanShowAd())
    {
        rewardedAd.Present((Reward reward) =>
        {
            //Advert Present Log
            Debug.Log(String.Format(rewardMsg, reward.Kind, reward.Quantity));
        });
    }
}

non-public void RegisterEventHandlers(RewardedAd advert)
{
    // advert closed Log
    advert.OnAdFullScreenContentClosed += () =>
    {
        Debug.Log("Rewarded advert full display screen content material closed.");
    };
}

https://builders.google.com/admob/unity/rewarded?hl=ko

As for the supply code, solely the appId is related to our app within the information on the positioning.

After I returned from the background to the foreground, I checked via logcat that the “Advert Present” and “Advert Shut” occasions had been occurring on the similar time.

My largest query is that in Unity, I perceive that there’s a solution to examine if the consumer is displaying the sport on the display screen via OnApplicationPause.

Error qdgralloc GetSize: Unrecognized pixel format: 0x38
Error Gralloc4 isSupported(1, 1, 56, 1, ...) failed with 5
Error GraphicBufferAllocator Didn't allocate (4 x 4) layerCount 1 format 56 utilization b00: 5
Error AHardwareBuffer GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), deal with=0x0
Error qdgralloc GetSize: Unrecognized pixel format: 0x3b
Error Gralloc4 isSupported(1, 1, 59, 1, ...) failed with 5
Error GraphicBufferAllocator Didn't allocate (4 x 4) layerCount 1 format 59 utilization b00: 5
Error AHardwareBuffer GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), deal with=0x0
Error qdgralloc GetSize: Unrecognized pixel format: 0x38
Error Gralloc4 isSupported(1, 1, 56, 1, ...) failed with 5
Error GraphicBufferAllocator Didn't allocate (4 x 4) layerCount 1 format 56 utilization b00: 5
Error AHardwareBuffer GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), deal with=0x0
Error qdgralloc GetSize: Unrecognized pixel format: 0x3b
Error Gralloc4 isSupported(1, 1, 59, 1, ...) failed with 5
Error GraphicBufferAllocator Didn't allocate (4 x 4) layerCount 1 format 59 utilization b00: 5
Error AHardwareBuffer GraphicBuffer(w=4, h=4, lc=1) failed (Unknown error -5), deal with=0x0

As well as, it’s displayed because the corresponding error code.

I would prefer to know if the Admob system can pause adverts via that characteristic, and I would prefer to know if iOS has an computerized processing characteristic.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles