flutter_mopub
A new Flutter plugin that uses native platform views to show mopub rewarded video ads!
Installation
- Depend on it Add this to your package's pubspec.yaml file:
dependencies:
flutter_mopub: ^0.0.1
- 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.
- Import it Now in your Dart code, you can use:
import 'package:flutter_mopub/flutter_mopub.dart';
Supported Platforms
0.2.0
>= AndroidX10.0
>= iOS
Supported MoPub features
- Rewarded Video Ads
Android integration
- Change minimum sdk to 19 :
- Open app level build.gradle file (android/app/build.gradle)
- In android->defaultConfig scope change this line
defaultConfig {
.
.
.
minSdkVersion 19 //default is 16
.
.
.
multiDexEnabled true //add this line if you have build errors
}
- In dependencies scope add this line (to resolve conflict between packages. apply only if you face build errors)
dependencies {
.
.
.
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava' //add this line
.
.
.
}
iOS integration
- Change minimum platform target to iOS 10.0 :
- Open ios/Runner.xcworkspace in xcode
- In Runner target -> Deployment Info -> change Target to iOS 10.0
- Configure App Transport Security (ATS) : Add this key value to your ios/Runner/info.plist
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsForMedia</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>
- view MoPub ATS guide for more info