Facebook Audience Network 플러그인은 Flutter 개발자가 앱에 네이티브 광고를 통합할 수 있도록 해줍니다. 배너, 인터스티셜, 보상형 비디오, 네이티브 광고 등 다양한 광고 형식을 지원하며, 안드로이드 및 iOS 플랫폼 모두에서 수익화가 가능합니다. 이 플러그인은 광고를 로드하고 표시하기 위한 간단한 인터페이스를 제공하며, Facebook의 광범위한 광고 네트워크를 활용해 고품질이고 타겟된 콘텐츠를 제공합니다. 개발자는 제공된 Flutter API를 사용하여 최소한의 설정으로 이러한 기능을 쉽게 구현할 수 있습니다.
NativeAdType NATIVE_AD_HORIZONTAL & NATIVE_AD_VERTICAL ad types are supported only in iOS. In Android use NATIVE_AD.
FacebookNativeAd(
placementId: "YOUR_PLACEMENT_ID",
adType: NativeAdType.NATIVE_AD,
width: double.infinity,
height: 300,
backgroundColor: Colors.blue,
titleColor: Colors.white,
descriptionColor: Colors.white,
buttonColor: Colors.deepPurple,
buttonTitleColor: Colors.white,
buttonBorderColor: Colors.white,
keepAlive: true, //set true if you do not want adview to refresh on widget rebuild
keepExpandedWhileLoading: false, // set false if you want to collapse the native ad view when the ad is loading
expandAnimationDuraion: 300, //in milliseconds. Expands the adview with animation when ad is loaded
listener: (result, value) {
print("Native Ad: $result --> $value");
},
),
6. Show Native Banner Ad:
Use NativeBannerAdSize to choose the height for Native banner ads. height property is ignored for native banner ads.