fairbid_flutter 0.5.2

  • Readme
  • Changelog
  • Example
  • Installing
  • new60

fairbid_flutter #

Unofficial plugin for FairBid 2.x SDK from Fyber - the advertisement mediation platform. Supports banner, interstitial and rewarded video ads.

Getting Started #

Before you start you need to be at least familiar with FairBid SDK official documentation. Topics you should be familiar with:

  • publisher UI - to configure apps and prepare ad placements
  • mediation networks integration - to learn how to setup your Android/iOS projects to provide additional mediation platforms
  • ad types provided by FairBid SDK - to know what suits your needs and how to use different ad types

SDK setup #

Create account Publishers UI and create configurations for Android and/or iOS app. App Ids has to be used to initialize SDK as described on official documentation for Android and iOS. You need to pass App Id for the platform your app is running on.

var appId = Platform.isAndroid ? _ANDROID_APP_ID : _IOS_APP_ID;
sdk = FairBid.forOptions(Options(
        appId: appId
      ));

You should keep reference to the FairBid instance to create ad placement holders.

Full screen ads #

  1. Initialize ad holder with placement id for the correct platform.
var interstitialPlacementId = Platform.isAndroid ? _ANDROID_INTERSTITIAL_PLACEMENT_ID : _IOS_INTERSTITIAL_PLACEMENT_ID;
var interstitialAd = sdk.prepareInterstitial(interstitialPlacementId);

var rewardedPlacementId = Platform.isAndroid ? _ANDROID_REWARDED_PLACEMENT_ID : _IOS_REWARDED_PLACEMENT_ID;
var rewardedAd = sdk.prepareRewarded(rewardedPlacementId);
  1. Request for a fill for an ad.
await ad.request();

Please note that the completion of request() doesn't mean the ad is available but only that requesting process has been started.

  1. Check if there is a fill available.
var adAvailable = await ad.isAvailable();
  1. Show ad when fill is available.
await ad.show();
  1. Initialize ad holder with placement id for the correct platform.
var bannerPlacementId = Platform.isAndroid ? _ANDROID_BANNER_PLACEMENT_ID : _IOS_BANNER_PLACEMENT_ID;
var bannerAd = sdk.prepareBanner(bannerPlacementId);
  1. Load and show banner on the screen.
await bannerAd.show(alignment: BannerAlignment.top);

Banners would show immediately and refresh automatically when ready.

  1. When banner should not be visible on the screen it should be destroyed.
await bannerAd.destroy();

You can show that you appreciate my work by sending a donation.

Donate with PayPal

0.5.2 (SDK 2.5.0) #

  • Fix file name issue for Android

0.5.1 (SDK 2.5.0) #

  • Improve description
  • Improve code quality

0.5.0 (SDK 2.5.0) #

  • Support for FairBid SDK 2.5.0

example/README.md

fairbid_flutter_example #

Demonstrates how to use the fairbid_flutter plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  fairbid_flutter: ^0.5.2

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:fairbid_flutter/fairbid_flutter.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
19
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
60
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
flutter 0.0.0
meta ^1.1.7 1.1.8
Transitive dependencies
collection 1.14.11 1.14.12
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test