{"id":26833609,"url":"https://github.com/mr-won/google_mobile_ads","last_synced_at":"2025-03-30T15:29:29.427Z","repository":{"id":138422901,"uuid":"597942580","full_name":"mr-won/Google_Mobile_Ads","owner":"mr-won","description":"Flutter 광고로 돈 버는 법(Banner, Interstitial \u0026 Rewarded Ad)","archived":false,"fork":false,"pushed_at":"2023-02-06T04:52:56.000Z","size":297,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T02:27:09.840Z","etag":null,"topics":["admob","flutter-admob","google-mobile-ads"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mr-won.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-06T03:28:44.000Z","updated_at":"2024-09-28T22:53:01.000Z","dependencies_parsed_at":"2023-08-20T14:07:09.260Z","dependency_job_id":null,"html_url":"https://github.com/mr-won/Google_Mobile_Ads","commit_stats":null,"previous_names":["wonttan/google_mobile_ads","wonchihyeon/google_mobile_ads","chihyunwon/google_mobile_ads","mr-won/google_mobile_ads","chihyeonwon/google_mobile_ads"],"tags_count":null,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-won%2FGoogle_Mobile_Ads","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-won%2FGoogle_Mobile_Ads/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-won%2FGoogle_Mobile_Ads/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mr-won%2FGoogle_Mobile_Ads/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mr-won","download_url":"https://codeload.github.com/mr-won/Google_Mobile_Ads/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246338154,"owners_count":20761332,"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","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","flutter-admob","google-mobile-ads"],"created_at":"2025-03-30T15:29:28.801Z","updated_at":"2025-03-30T15:29:29.419Z","avatar_url":"https://github.com/mr-won.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# googleads\n\n## 필요한 라이브러리 설치\n[구글 애드몹 사이트](https://admob.google.com/intl/ko/home/) | [google_mobile_ads 개발문서](https://pub.dev/packages/google_mobile_ads)\n```\n구글 애드몹(Google Admob)사이트에 회원가입을 하고 프로젝트의 터미널에서 \nflutter pub add google_mobile_ads 명령어로 필요한 라이브러리를 설치해줍니다.\n```\n![image](https://user-images.githubusercontent.com/58906858/216880409-976f9900-ed62-4f6c-b2ea-9ebf286536d4.png)\n\n## google_mobile_ads App Id 설정하기\n```\n구글 애드몹 사이트에서 테스트용 앱을 생성하고 발급받은 Id를 AndroidManifest에서 설정해주어야 합니다.\nAndroidManifest에 다음 코드를 작성하여 애드몹 Id를 추가해주었습니다.\n```\n![image](https://user-images.githubusercontent.com/58906858/216881996-55f3b4c9-0807-407c-bdb7-cc426bd427c9.png)\n![image](https://user-images.githubusercontent.com/58906858/216882065-4b8593fc-feae-4294-888d-3a7cd70c1cd5.png)\n\n## 테스트용 ID의 사용\n[Admob Test Id 모음](https://unitytip.tistory.com/33)\n```\n광고 조작을 마음대로 하면 Block 차단당할 위험이 있기 때문에 테스트(디버깅)단계에서는 반드시\n다음의 테스트 ID를 사용합니다. 향후 실제로 앱에 광고를 넣을 때는 ID부분을 애드몹 App Id로 변경해줍니다.\n```\n![image](https://user-images.githubusercontent.com/58906858/216882345-6154106b-d7c8-4255-b457-52b0f4750695.png)\n![image](https://user-images.githubusercontent.com/58906858/216882480-c334fe3c-f344-44fe-bac0-63e0d09d6a51.png)\n\n## banner 객체 생성과 설정하기\n```\ngoogle_mobile_ads 라이브러리를 프로젝트에서 import하고 bannerAd 타입의 banner 객체를 하나 생성합니다.\nbanner를 initState()안에서 설정해 줍니다.\nbanner는 bannerAd()의 4개의 필요한 옵션을 설정하여야 합니다(required).\n각 옵션을 살펴보면,\nlistener : 광고가 로딩이 되었을 때, 실패했을 때, 클릭했을 때 등 이벤트를 넣거나 통계를 따거나 할 때 사용할 수 있습니다.\nsize : 광고의 크기를 설정해 줄 수 있습니다.\nadUnitId : 유닛 아이디 즉 안드로이드와 ios 기종에 맞는 앱 아이디를 넣어주면 됩니다. 여기서는 위에서 만든 테스트용 아이디를 넣어주었습니다.\nrequest : 키워드를 설정할 수 있습니다. 기대 효과 CPM을 높혀서 광고 수익을 늘리거나 할 수 있습니다. (CPM은 1000회 노출당 비용을 의미하는 'cost per 1000 impressions'의 약자)\n\n이렇게 하면 광고 배너의 설정은 끝이 납니다.\n```\n![image](https://user-images.githubusercontent.com/58906858/216882812-9a4d3faf-eaeb-4916-84d7-593e21d5e5b4.png)\n![image](https://user-images.githubusercontent.com/58906858/216883351-5fc454fa-1076-409f-9439-c337b14751b6.png)\n\n## 앱 맨 밑에 광고 배너가 들어가는 상황 설정\n[mergeExtDexDebug 오류 해결방법](https://kwonsaw.tistory.com/412)\n```\n애플리케이션 맨 밑에 광고 배너가 들어가는 상황을 설정해보고 테스트 해 보겠습니다.\n\nListView.seperated으로 0부터 100개의 리스트를 만들어 주고 맨 밑에\nContainer(height:50)만큼의 공간에 광고 배너를 넣는다고 가정하겠습니다.\n\n중간에 Execution failed for task ':app:mergeExtDexDebug' 오류가 떴는데 이는 오류 해결방법을 구글링해서\n찾아서 해결하였습니다.\n```\n![image](https://user-images.githubusercontent.com/58906858/216885848-9ba29a5e-2ee7-426c-8b7c-afd9b3a13ee1.png)\n## [앱 최하단에 테스트 광고 배너가 생긴 모습]\n![image](https://user-images.githubusercontent.com/58906858/216885883-513caaad-1457-4e44-8496-57403ef70fc4.png)\n## [테스트 광고 배너를 클릭했을 때]\n![image](https://user-images.githubusercontent.com/58906858/216885943-777c4103-a10c-4e8a-b035-f18acd9c408f.png)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-won%2Fgoogle_mobile_ads","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmr-won%2Fgoogle_mobile_ads","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-won%2Fgoogle_mobile_ads/lists"}