搜索插件、代码仓与 APP 分类

插件详情v0.0.4

fan_easy

FanEasy 是一个简单的 Flutter 包,可轻松集成 Facebook Audience Network 广告,并提供易于使用的方法。

AndroidiOS
近 30 天下载
56
喜欢数
3
Pub 分数
150

安装插件

flutter pub add fan_easy

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

FanEasy 是一个轻量级的 Flutter 包,旨在简化在 Flutter 应用中集成 Facebook Audience Network 广告的过程。它提供了简单的方法,可在 Android 和 iOS 平台上加载和显示横幅广告、插页式广告和原生广告。通过最少的设置和清晰的文档,开发者无需深入了解原生 SDK 即可快速实现广告功能。该包抽象了复杂的配置,非常适合需要快速部署广告功能的项目。

适合场景

  • 集成 Facebook 广告网络横幅
  • 在应用界面之间显示插页广告
  • 在内容提要中显示原生广告
  • monetizing small to medium-sized apps
  • 在开发过程中启用快速广告测试

主要特点

  • 简单、直观的 API
  • 跨平台支持(Android 和 iOS)
  • 支持多种广告类型
  • 最小配置要求
  • 自动生命周期管理

适合对象

  • Flutter 开发者新手入门广告集成
  • 寻求快速变现的应用程序
  • 项目在原生SDK设置方面时间有限
  • 偏好声明式广告处理的开发者

使用建议

  • 需要 Facebook 开发者账户
  • 广告可用性取决于地区和填充率
  • 与原生 SDK 相比,自定义选项有限
  • 不适合高级广告定位需求

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

FanEasy

FanEasy is a simple and efficient Flutter package for integrating Facebook Audience Network ads seamlessly. It provides easy-to-use methods for loading and displaying various ad formats.

Features

  • Load and show Interstitial Ads
  • Load and show Rewarded Ads
  • Display Banner Ads
  • Display Native Ads
  • Check if ads are loaded

Installation

Add this to your pubspec.yaml file:

dependencies:
  fan_easy: any

Then run:

flutter pub get

Usage

Initialization

Before using any ad feature, initialize the SDK:

import 'package:fan_easy/fan_easy.dart';

void main() {
  FanEasy.instance.loadInit(testingId: "YOUR_TESTING_ID");
}
Load and Show Interstitial Ads
FanEasy.instance.loadInterstitial(placementId: "YOUR_INTERSTITIAL_PLACEMENT_ID");

if (FanEasy.instance.interstitialLoaded) {
  FanEasy.instance.showInterstitial();
}
Load and Show Rewarded Ads
FanEasy.instance.loadRewarded(placementId: "YOUR_REWARDED_PLACEMENT_ID");

if (FanEasy.instance.rewardedLoaded) {
  FanEasy.instance.showRewarded();
}
Display Banner Ads
FanEasy.instance.bannerAd(placementId: "YOUR_BANNER_PLACEMENT_ID")
Display Native Ads
FanEasy.instance.nativeAd(placementId: "YOUR_NATIVE_PLACEMENT_ID")

Example

import 'package:flutter/material.dart';
import 'package:fan_easy/fan_easy.dart';

void main() {
  runApp(MyApp());
  FanEasy.instance.loadInit(testingId: "YOUR_TESTING_ID");
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text("FanEasy Example")),
        body: AdExamplePage(),
      ),
    );
  }
}

class AdExamplePage extends StatefulWidget {
  @override
  _AdExamplePageState createState() => _AdExamplePageState();
}

class _AdExamplePageState extends State<AdExamplePage> {
  @override
  void initState() {
    super.initState();
    FanEasy.instance.loadInterstitial(placementId: "YOUR_INTERSTITIAL_PLACEMENT_ID");
    FanEasy.instance.loadRewarded(placementId: "YOUR_REWARDED_PLACEMENT_ID");
  }

  @override
  Widget build(BuildContext context) {
    return Center(
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          ElevatedButton(
            onPressed: () => FanEasy.instance.showInterstitial(),
            child: Text("Show Interstitial Ad"),
          ),
          ElevatedButton(
            onPressed: () => FanEasy.instance.showRewarded(),
            child: Text("Show Rewarded Ad"),
          ),
          SizedBox(height: 20),
          FanEasy.instance.bannerAd(placementId: "YOUR_BANNER_PLACEMENT_ID"),
          SizedBox(height: 20),
          FanEasy.instance.nativeAd(placementId: "YOUR_NATIVE_PLACEMENT_ID"),
        ],
      ),
    );
  }
}

License

This package is licensed under the MIT License.

所属分类

依赖

依赖清单 1 项

  • easy_audience_network^0.0.7

源码仓库

使用此插件的项目

暂无相关数据。