Prerequisites
Flutter
3.3.0
or higherAndroid
Use Android Studio 3.2 or higher.
Make sure that your app’s build file uses the following values:
A
minSdkVersion
of21
or higher.A
compileSdkVersion
of28
or higher.
iOS
Use XCode 15.2 or higher.
A
minimumDeploymentTarget
is12
or higher.
Step Summary
Add “Refinery89 Monetize App“ dependency from Pub.dev.
Android configurations.
iOS configurations.
Continue with the implementation type.
1. Add “Refinery89 Monetize App“ dependency
Add Refinery89 Monetize App for Flutter plugin to your pubspec.yaml
file.
dependencies: refinery89_monetize_app:
Install the package by running
flutter packages get
Import “Refinery89 Monetize App“ into your Flutter app.
import 'package:refinery89_monetize_app/r89_sdk.dart';
2. Android configurations
Manifest permissions
Add the following Permissions for SDK on the top of the manifest file:
<?xml version="1.0" encoding="utf-8"?> <manifest> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="com.google.android.gms.permission.AD_ID"/> </manifest>
Manifest Google ID
Add the App ID to your app's AndroidManifest.xml
file. To do so, add a <meta-data>
tag with android:name="com.google.android.gms.ads.APPLICATION_ID"
, and for android:value
, insert the App ID, surrounded by quotation marks.
Add this code to the manifest inside the <application>
tag:
<manifest> <application> <!-- This is the Sample App ID--> <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713"/> </application> </manifest>
You will receive your app ID through your Technical Account manager by email, you can also retrieve them from the web interface after login.
Manifest end result
This is a simplified example, you should have many more lines in the manifest, copy the important bits only.
<manifest> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="com.google.android.gms.permission.AD_ID"/> <application> <!-- This is the Sample App ID--> <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713"/> </application> </manifest>
2. iOS Configurations
Add Info.plist Google App Id
Add the App Id to your info.plist file.
<key>GADApplicationIdentifier</key> <string>ca-app-pub-3940256099942544~1458002511</string>
The App ID in the Snippet is a Sample can be used for testing but not for prod apps
You will receive your app ID through your Technical Account manager by email, you can also retrieve them from the web interface after login.
Add Info.plist Ad Networks
Add the Ad Networks to your Info.plist file.
Only read the following step if your technical account manager didn’t already provide an Implementation type to follow, otherwise continue there.
Choose an Implementation Type
Single Tag Implementation
This is what you are looking for? continue here → Flutter Single Tag Implementation
This Implementation provides a way that with minimal code you can remotely control where and how to show the ad inventory.
You will have full remote control over Ad Inventory configurations and with the addition of tags to your wrapper, you will have where you show the inventory.
This is the easiest monetization setup, because all configurations for the Units are done in the Remote Server, you just need to add the tags on the “white spaces of your app” where you might or might not place ads, so no need to manually request request the ads in those places.
This option is recommended under the following circumstances:
You App is native and you are able to add tags to your views
Wants to Disable and enable Inventory slots without updating the application.
Wants tos Edit the ad units remotely over the web without updating the application.
Wants to Change Formats, slot place, sizes, etc.
Manual Implementation
This is what you are looking for? continue here → Flutter Manual Implementation
This implementation is designed for situations where the Single tag might not align with your requirements, but you can still leverage the benefits of remote inventory configuration.
You can see an example in Flutter Demo Applications
Manual configuration means that you have remote control of General Ad Settings over the web or our tech support, but you need to add the ads manually, so instead of just placing the tags you need to create a wrapper and use it to do a request for the format that you want.
This option is recommended under the following circumstances:
Wants control over the logic of showing the Inventory.
You are using a framework that we don’t support but you can use native android code.
You have a web-application but you are not using our monetization in your web and want to place ads natively.
Comparison table
Feature | Manual | Single Tag |
---|---|---|
Integrated CMP. | ✅ | ✅ |
Custom auctions in R89 Servers. | ✅ | ✅ |
All Formats supported. | ✅ | ✅ |
Remote Unit Configs. | ✅ | ✅ |
Remote Ad Places. | ✅ | |
Local Testing without R89 DB or Servers. | ✅ |
|