{"id":15731460,"url":"https://github.com/0xwdg/admob-swiftui","last_synced_at":"2026-05-09T16:39:07.656Z","repository":{"id":221993760,"uuid":"755902413","full_name":"0xWDG/Admob-SwiftUI","owner":"0xWDG","description":"This library helps you to easily integrate the Admob SDK in your SwiftUI app. It is a wrapper around the Google Mobile Ads SDK for iOS. It provides a SwiftUI view that you can use to display banner ads in your app above your tabbar.","archived":false,"fork":false,"pushed_at":"2025-02-20T20:19:21.000Z","size":2145,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-11T02:46:19.670Z","etag":null,"topics":["admob","ads","google","hacktoberfest","package","spm","swift","swift-ui","swiftlang","swiftpm","swiftui"],"latest_commit_sha":null,"homepage":"https://0xwdg.github.io/Admob-SwiftUI/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0xWDG.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-11T12:39:00.000Z","updated_at":"2025-02-20T20:18:30.000Z","dependencies_parsed_at":"2024-06-06T17:09:21.259Z","dependency_job_id":"0047ff51-4bba-46a8-a7b6-af64ea28d12a","html_url":"https://github.com/0xWDG/Admob-SwiftUI","commit_stats":null,"previous_names":["0xwdg/admob-swiftui"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/0xWDG/Admob-SwiftUI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xWDG%2FAdmob-SwiftUI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xWDG%2FAdmob-SwiftUI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xWDG%2FAdmob-SwiftUI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xWDG%2FAdmob-SwiftUI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0xWDG","download_url":"https://codeload.github.com/0xWDG/Admob-SwiftUI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0xWDG%2FAdmob-SwiftUI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279005963,"owners_count":26084004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["admob","ads","google","hacktoberfest","package","spm","swift","swift-ui","swiftlang","swiftpm","swiftui"],"created_at":"2024-10-04T00:01:46.213Z","updated_at":"2025-10-11T02:46:20.331Z","avatar_url":"https://github.com/0xWDG.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Admob for SwiftUI\n\nThis library helps you to easily integrate the Admob SDK in your SwiftUI app. It is a wrapper around the Google Mobile Ads SDK for iOS. It provides a SwiftUI view that you can use to display banner ads in your app above your tabbar.\nSee my blog post for more information: https://wesleydegroot.nl/blog/post/Admob-in-SwiftUI\n\n\n## Requirements\n\n- Swift 5.9+ (Xcode 15+)\n- iOS 15+\n\n## Installation\n\nInstall using Swift Package Manager\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/0xWDG/Admob-SwiftUI.git\", .branch(\"main\")),\n],\ntargets: [\n    .target(name: \"MyTarget\", dependencies: [\n        .product(name: \"Admob_SwiftUI\", package: \"Admob_SwiftUI\"),\n    ]),\n]\n```\n\nAnd import it:\n```swift\nimport Admob_SwiftUI\n```\n\n# Usage\n```swift\nstruct MyApp: App {\n    @ObservedObject var adHelper = AdHelper(\n        adUnitId: \"YOUR-AD-UNIT-ID\"\n    )\n\n    var body: some Scene {\n        WindowGroup {\n            ContentView()\n                .environmentObject(adHelper)\n        }\n    }\n}\n\nstruct ContentView: View {\n    @EnvironmentObject\n    var adHelper: AdHelper\n\n    var body: some View {\n        AdView {\n            TabView {\n                UpdateConsent()\n                    .tabItem {\n                        Image(systemName: \"2.square.fill\")\n                        Text(\"Second\")\n                    }\n\n                SecondView()\n                    .tabItem {\n                        Image(systemName: \"1.square.fill\")\n                        Text(\"First\")\n                    }\n            }\n        }\n    }\n}\n\nstruct SecondView: View {\n    @EnvironmentObject\n    var adHelper: AdHelper\n\n    var body: some View {\n        BannerView() // A banner view.\n    }\n}\n```\n\n**Reset/Update Consent**\n```Swift\nstruct UpdateConsent: View {\n    @EnvironmentObject\n    private var adHelper: AdHelper\n\n    var body: some View {\n        ScrollView {\n            VStack {\n                Button(\"Reset consent\", role: .destructive) {\n                    adHelper.resetConsent()\n                }\n\n                Button(\"Update Consent\") {\n                    adHelper.updateConsent()\n                }\n            }\n        }\n    }\n}\n```\n\n## Contact\n\n🦋 [@0xWDG](https://bsky.app/profile/0xWDG.bsky.social)\n🐘 [mastodon.social/@0xWDG](https://mastodon.social/@0xWDG)\n🐦 [@0xWDG](https://x.com/0xWDG)\n🧵 [@0xWDG](https://www.threads.net/@0xWDG)\n🌐 [wesleydegroot.nl](https://wesleydegroot.nl)\n🤖 [Discord](https://discordapp.com/users/918438083861573692)\n\nInterested learning more about Swift? [Check out my blog](https://wesleydegroot.nl/blog/).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xwdg%2Fadmob-swiftui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0xwdg%2Fadmob-swiftui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0xwdg%2Fadmob-swiftui/lists"}