1. Windows에서 Flutter에 Firebase 추가하기를 참고해서 CLI 툴 설치
2. Firebase 콘솔에서 앱 선택 후 "Hosting" > 시작하기 클릭
3. public으로 호스팅할 폴더를 생성한다. (e.g. C:\Users\me\StudioProjects\public_for_hosting_ads )
4. CLI에서 해당 폴더로 이동 후 firebase init 수행
5. 프롬프트에 대해서 다음과 같이 선택
? Are you ready to proceed? Yes
? Which Firebase features do you want to set up for this directory? Press Space to select features, then Enter to
confirm your choices. Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys
=== Project Setup
First, let's associate this project directory with a Firebase project.
You can create multiple project aliases by running firebase use --add,
but for now we'll just set up a default project.
? Please select an option: Use an existing project
? Select a default Firebase project for this directory: babylingual-33707 (babylingual)
i Using project babylingual-33707 (babylingual)
=== Hosting Setup
Your public directory is the folder (relative to your project directory) that
will contain Hosting assets to be uploaded with firebase deploy. If you
have a build process for your assets, use your build's output directory.
? What do you want to use as your public directory? public
? Configure as a single-page app (rewrite all urls to /index.html)? No
? Set up automatic builds and deploys with GitHub? No
+ Wrote public/404.html
+ Wrote public/index.html
i Writing configuration info to firebase.json...
i Writing project information to .firebaserc...
i Writing gitignore file to .gitignore...
+ Firebase initialization complete!
6. public 폴더에 app-ads.txt 파일 생성
7. Google AdMob에서 모든 앱 > app-ads.txt > app-ads.txt 설정 방법 클릭
8. 파일 내용에 아래와 같은 모달에 제공된 코드를 붙여넣는다.
9. cmd에서 다음 명령어 수행
`firebase deploy --only hosting`
10. 완료 후 CLI 툴에서 출력된 Hosting URL 접속해 확인
11. 구글 플레이 콘솔 > 앱 선택 > 사용자 늘리기 > 앱 정보 > 스토어 설정 > 스토어 등록정보 연락처 세부정보 > 웹사이트를 Hosting URL로 변경
12. Google AdMob에서 권장 조치 2. 업데이트 확인 버튼 클릭 시 성공
'Flutter' 카테고리의 다른 글
Windows에서 Flutter에 Firebase 추가하기 (0) | 2025.05.30 |
---|---|
Flutter 광고 로딩 실패 시 재시도 로직 - Exponential Backoff, 점진적 대기 시간 증가 적용하기 (0) | 2025.05.24 |
Flutter 앱 서명하는 법 (1) | 2025.04.16 |
setState() or markNeedsBuild() called during build 에러 원인과 해결 (1) | 2025.03.23 |
Consider canceling any active work during "dispose" or using the "mounted" getter to determine if the State is still active. 에러 원인과 해결 방법 (0) | 2025.03.20 |