搜尋套件、儲存庫與 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

原始碼儲存庫

使用此套件的專案

暫無相關資料。