FLUTTER ECOSYSTEM

matifdeveloper/fan_easy

FanEasy 是一個簡單的 Flutter 套件,可輕鬆整合 Facebook Audience Network 廣告,並提供易用的方法。

fan_easy 專案封面
Stars
0
Forks
0
最近推送(UTC)
2025年3月8日
專案狀態
未封存
Muhammad Atif GitHub avatar
GITHUB User

Muhammad Atif ↗

Flutter Developer || Android Developer || iOS Developer || Kotlin Native || Core PHP || SQL || App Publisher || Software Engineer || Google Ads || MVVM || MVC

Gamican Pvt Ltd.Mohallah Janas khel, Village Urmar Payan, Peshawar
語言Dart

此儲存庫發佈的套件

使用的依賴

依賴清單 4 項
  • flutter{"sdk":"flutter"}
  • easy_audience_network^0.0.7
  • flutter_test開發依賴{"sdk":"flutter"}
  • flutter_lints開發依賴^5.0.0

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 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.