Earn real money from Flutter Application by implement Facebook Ad

In this post, we are going to learn how to earn real money from Flutter application by simply implementing Facebook ads (Facebook Audience Network)
In order to show Facebook ads into the flutter application, we need to implement the package which we get from https://pub.dev.
Follow the below step to add package into our application.
1. Depend on it
Add this to your package’s pubspec.yaml file:
dependencies:
facebook_audience_network: ^0.7.1
2. Install it
You can install packages from the command line:
with Flutter:
$ flutter pub get
Alternatively, your editor might support flutter pub get
. Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
import 'package:facebook_audience_network/facebook_audience_network.dart';
In this post, we are going to use testing project id and placement id to show various ads like (Banner ad and Interstitial ad), to get real project id we have to provide our application for review to Facebook, once they approve we get project id and after we can create placement id as per our requirement.
Let’s check how to implement it.
First of all, we need to initialize FacebookAudieceNetwork lib, init state is the best place to do so, so we will init.

The _loadInterstitialAd() is function to load interstitial ad, function contains code like below.

Generally, Interstitial ads show when user change activity, such that went from list to detail screen or when go back from detail screen to back. So we create a method which will check isInterstitial ad is loaded if so, then it will display the ad or we can request again to load an interstitial ad. Below method is used to show the interstitial ad.

Banner Ad

Interstitial Ad

Here is a GitHub repo where one can find the whole implementation.
Please do let me know if you found any problem while integration, I will try my best to provide a solution.