Prerequisites
- Flutter
3.3.0
or higher- Android
- 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.
- A
- iOS
- Use XCode 15.2 or higher.
- A
minimumDeploymentTarget
is12
or higher.
- Android
App Configuration
1. Add “Refinery89 Monetize App“ dependency from Pub.dev.
-
Add Refinery89 Monetize App for Flutter plugin to your
pubspec.yaml
file.
dependencies: refinery89_monetize_app:
-
Install the package by running the following command
flutter packages get
-
Import “Refinery89 Monetize App“ into your Flutter app.
import 'package:refinery89_monetize_app/r89_sdk.dart';
2. Android Configuration.
2.1 Gradle Dependencies
In this project build.gradle:
allprojects { repositories { google() mavenCentral() } }
2.2 Add Google ID Manifest.
Add this code to the manifest inside the <application>
tag:
<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value=<the-google-id>/>
-
Test: Use
"ca-app-pub-3940256099942544~3347511713"
for<the-google-id>
this is from google official docs -
Production: Use your own Google Id provided by us for
<the-google-id>
.
If you have your own Google ID, follow these steps in the ‘Find the Google Mobile Ads Application IDs’ section.
A simplified example would look something like this:
<manifest> <application ...> <!-- The value is the test id from Google ad manager docs --> <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value=<the-google-id>/> ... <activity ...> ... </activity> </application> </manifest>
<manifest> <application ... android:theme="@style/Theme.AppCompat.NoActionBar" ...> ... </application> </manifest>
3. iOS Configuration.
According to Google Ads documentation update the Info.plist
file to add the following two keys.
-
A
GADApplicationIdentifier
key with a string value of your AdMob app ID found in the AdMob UI. -
A
SKAdNetworkItems
key withSKAdNetworkIdentifier
values for Google (cstr6suwn9.skadnetwork) and select third-party buyers who have provided these values to Google.
4. Flutter Configuration.
O R89SDK
uses the navigatorObservers
to properly destroy ads when the screen closes and to track the route transitions to display interstitial ads if configured.
@override Widget build(BuildContext context) { return MaterialApp( // ... navigatorObservers: [ R89SDK.routeObserver, ], // ... ); }
4. Initialize “Refinery89 Monetize App“ SDK.
-
Single Tag Initialization
Make sure to follow the Single Tag Initialization tutorial.
Template: Link. -
Manual Initialization
Make sure to follow the Manual Initialization tutorial.
Template: Link.
Before opting for the initialization type, please consider reviewing the comparison page ou entre em contato conosco.
Formats Available