Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I get the CrossMauiMTAdmob.Current.AdsId variable in my MainPage.xaml? #51

Open
rdemboski opened this issue Dec 29, 2023 · 0 comments

Comments

@rdemboski
Copy link

My app.xaml.cs file contains this:

using Plugin.MauiMTAdmob;

namespace MauiApp2
{
public partial class App : Application
{
public App()
{
InitializeComponent();

        // Set the Ad Unit ID based on the platform
        CrossMauiMTAdmob.Current.AdsId =
        DeviceInfo.Platform == DevicePlatform.Android
        ? "ca-app-pub-3940256099942544/8214777181"
        : "ca-app-pub-3940256099942544/4255350878";

        MainPage = new AppShell();
    }
}

}

how can I use the value of CrossMauiMTAdmob.Current.AdsId in my MainPage.xaml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant