marcojak / MauiMTAdmob

MIT License
104 stars 17 forks source link

The adv is not be shown the first times #40

Closed erossini closed 4 months ago

erossini commented 10 months ago

In my page, I added a Rewarded adv. In the constructor of the page I added

    public ProfilePage(ProfilePageViewModel model)
    {
        InitializeComponent();

#if ANDROID || IOS
        CrossMauiMTAdmob.Current.TagForChildDirectedTreatment = MTTagForChildDirectedTreatment.TagForChildDirectedTreatmentUnspecified;
        CrossMauiMTAdmob.Current.TagForUnderAgeOfConsent = MTTagForUnderAgeOfConsent.TagForUnderAgeOfConsentUnspecified;
        CrossMauiMTAdmob.Current.MaxAdContentRating = MTMaxAdContentRating.MaxAdContentRatingG;
#endif
    }

then on Clicked I added this code

    private async void buttonEarn_Clicked(object sender, EventArgs e)
    {
#if IOS || ANDROID
        CrossMauiMTAdmob.Current.LoadRewarded(DeviceInfo.Current.Platform == DevicePlatform.Android ? Constants.AndroidReward1 : Constants.iOSReward1);
        CrossMauiMTAdmob.Current.ShowRewarded();
#else
        await DisplayAlert(AppResources.AdvNewPointsTitle, AppResources.AdvNoPlatformSupported, AppResources.OK);
#endif
    }

The result is that I have to click a few times before the app shows the rewarded adv. Here a video.

https://github.com/marcojak/MauiMTAdmob/assets/9497415/06d36c44-f76b-4865-95f6-9c378f775273

After the first time, to click again on the button, I have to restart the app.

marcojak commented 4 months ago

Do you still have the same issue on the latest version?

erossini commented 4 months ago

No, I think it is fixed. Thank you.