-
Flutter) Debug 모드 Release 모드 체크 하기(참고자료)Programing Language/Flutter(Dart) 2021. 3. 21. 01:46728x90반응형
google Admobs달아줄때
디버그 모드에서는 실제 광고 단위 유닛 아이디를 입력하면 올바른 값이 나오지 않는다.
How to check flutter application is running in debug?
I have a short question. I'm looking for a way to execute code in Flutter when the app is in Debug mode. Is that possible in Flutter? I can't seem to find it anywhere in the documentation. Somethin...
stackoverflow.com
해당 자료를 참고하여 if 문으로 debug모드일때는 테스트 아이디를 넣어주고 release 모드 일때는 실제 광고 단위 유닛을 넣어주자.
ex )
@override
void initState() {
super.initState();
_bannerAd = BannerAd(
adUnitId: kReleaseMode ? AdManager.bannerAdUnitId : BannerAd.testAdUnitId,
request: AdRequest(),....
728x90반응형'Programing Language > Flutter(Dart)' 카테고리의 다른 글
Flutter) 플루터로 하이브리드 웹앱 만들기 (0) 2021.12.30 Flutter) 안드로이드 빌드시 status bar에 화면 겹치는 현상 해결하기 (0) 2021.12.30 Flutter) Android Release로 업로드하기! (0) 2021.03.21 Flutter) 구글 광고 달기 (AdMob) [참고자료] (0) 2021.03.21 Flutter) post 서버 통신하기 (0) 2021.03.19