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>