add show privacy form button

Seto committed Nov 24, 2025 at 16:15 UTC d63e1eff07e0f5f77d1231f642b82fdf98292db8
1 file changed +8 -5
examples/tauri-app/src/App.svelte
+8 -5
@@ -1,10 +1,8 @@
1 <script lang="ts">
2 - import { BannerAd, RewardedAd } from "tauri-plugin-admob-api";
2 + import { BannerAd, RewardedAd, showPrivacyOptionsForm } from "tauri-plugin-admob-api";
3 import Greet from "./lib/Greet.svelte";
4 import { onMount } from "svelte";
5
6 - let response = "";
7 -
6 const bannerAd = new BannerAd({
7 adUnitId: "ca-app-pub-3940256099942544/9214589741",
8 position: "top",
@@ -14,6 +12,10 @@
12 adUnitId: "ca-app-pub-3940256099942544/5224354917",
13 });
14
15 + async function showPrivacyForm() {
16 + await showPrivacyOptionsForm()
17 + }
18 +
19 async function showBannerAd() {
20 await bannerAd.show();
21 }
@@ -61,13 +63,14 @@
63 <Greet />
64 </div>
65
66 + <div class="row">
67 + <button on:click={showPrivacyOptionsForm}>Show Privacy Form</button>
68 + </div>
69 <div class="row">
70 <button on:click={showBannerAd}>Show Banner Ad</button>
66 - <div>{@html response}</div>
71 </div>
72 <div class="row">
73 <button on:click={showRewardedAd}>Show Rewarded Ad</button>
70 - <div>{@html response}</div>
74 </div>
75 </main>
76