privat:programmieren:mtadmob_plugin:mtadmob_plugin
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
| privat:programmieren:mtadmob_plugin:mtadmob_plugin [2025/12/30 10:59] – vitalij | privat:programmieren:mtadmob_plugin:mtadmob_plugin [2026/01/19 15:24] (aktuell) – gelöscht 216.73.216.40 | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| - | | ||
| - | | ||
| - | - Installiere das Paket MauiMTAdmob\\ {{.: | ||
| - | - In der AndroidManifest.xml folgenden code einfügen \\ <code | download> | ||
| - | < | ||
| - | android: | ||
| - | android: | ||
| - | android: | ||
| - | android: | ||
| - | < | ||
| - | android: | ||
| - | android: | ||
| - | </ | ||
| - | </ | ||
| - | android: | ||
| - | </ | ||
| - | - Unter \\ <code | download> | ||
| - | builder | ||
| - | .UseMauiApp< | ||
| - | // | ||
| - | .UseMauiMTAdmob() // <--- HIER hinzufügen | ||
| - | .UseLocalNotification() | ||
| - | .ConfigureFonts(fonts => | ||
| - | { | ||
| - | fonts.AddFont(" | ||
| - | fonts.AddFont(" | ||
| - | }); | ||
| - | </ | ||
| - | - Dann legst du eine Datei CrossPlatformAdBanner.cs unter Controls an \\ <code | download> | ||
| - | using Microsoft.Maui.Controls; | ||
| - | using Plugin.MauiMTAdmob.Controls; | ||
| - | using Plugin.MauiMTAdmob.Extra; | ||
| - | |||
| - | namespace DimCalc.Controls; | ||
| - | |||
| - | public class CrossPlatformAdBanner : ContentView | ||
| - | { | ||
| - | public CrossPlatformAdBanner(string AdsId_in) | ||
| - | { | ||
| - | #if ANDROID | ||
| - | // Hier läuft AdMob | ||
| - | Content = new AdMMTAdView | ||
| - | { | ||
| - | AdsId = AdsId_in, //" | ||
| - | HeightRequest = 50, | ||
| - | AdSize = BannerSize.AnchoredAdaptive | ||
| - | }; | ||
| - | |||
| - | #else | ||
| - | // Windows → AdSense via WebView | ||
| - | Content = new WebView | ||
| - | { | ||
| - | HeightRequest = 120, | ||
| - | Source = new UrlWebViewSource | ||
| - | { | ||
| - | Url = " | ||
| - | } | ||
| - | }; | ||
| - | #endif | ||
| - | } | ||
| - | } | ||
| - | </ | ||
| - | namespace DimCalc.Controls; | ||
| - | </ | ||
| - | - Unter <code | download> | ||
| - | using Plugin.MauiMTAdmob; | ||
| - | public static class MauiProgram | ||
| - | { | ||
| - | public static MauiApp CreateMauiApp() | ||
| - | { | ||
| - | string appId = " | ||
| - | string appIdTest = " | ||
| - | Preferences.Set(" | ||
| - | Preferences.Set(" | ||
| - | Preferences.Set(" | ||
| - | string dummy = Preferences.Get(" | ||
| - | string dummy1 = Preferences.Get(" | ||
| - | string dummy2 = Preferences.Get(" | ||
| - | </ | ||
| - | - mit der Zeile <code | download> | ||
| - | new CrossPlatformAdBanner(Preferences.Get(" | ||
| - | </ | ||
privat/programmieren/mtadmob_plugin/mtadmob_plugin.1767092346.txt.gz · Zuletzt geändert: von vitalij
