# tauri-plugin-ad2mob — iOS (Swift)
Swift implementation of the `tauri-plugin-ad2mob` mobile plugin for Tauri v2
(Google AdMob: banner, interstitial and rewarded ads + UMP consent + ATT).
The Rust core registers this package through
`register_ios_plugin(init_plugin_admob)`; SPM resolves it when the Tauri CLI
generates the Xcode project (`tauri ios build` / `tauri ios dev`). The command
surface, event names and reject codes are defined in
`docs/native-contract.md` (single source of truth).
## SPM dependencies
- `Tauri` — the Tauri iOS plugin API, generated by the Tauri CLI at
`../.tauri/tauri-api`.
- [`GoogleMobileAds`](https://github.com/googleads/swift-package-manager-google-mobile-ads)
(13.x) — `GADBannerView`, `GADInterstitialAd`, `GADRewardedAd`.
- [`GoogleUserMessagingPlatform`](https://github.com/googleads/swift-package-manager-google-user-messaging-platform)
(3.x) — the UMP consent flow (`requestConsentInfoUpdate`,
`loadAndShowIfRequired`).
## App requirements (owned by the consuming app)
- `GADApplicationIdentifier` in the app target's `Info.plist` — `initialize`
rejects with `INVALID_CONFIGURATION` when it is missing.
- `NSUserTrackingUsageDescription` in `Info.plist` when ATT is requested.
## Tests
`Tests/PluginTests/MappersTests.swift` covers the pure mapping helpers
(consent status, ATT status, banner size, banner position, event constants).
Run them against an iOS destination — `swift test` on a macOS host cannot link
the Google SDKs, which are iOS-only binary packages.
This layer cannot be compiled outside of Xcode/iOS tooling; correctness is
reviewed against the documented GoogleMobileAds 13.x / UMP 3.x API surface.