Skip to content

Release v1.0.2: Updated Flutter SDK to 3.27.3, improved Android build… #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@
# This file should be version controlled and should not be manually edited.

version:
revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713
revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
channel: stable

project_type: plugin
migration:
platforms:
- platform: root
create_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
base_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
- platform: android
create_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
base_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
- platform: ios
create_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
base_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
## 1.0.2

- Upgraded to Flutter 3.27.3
- Updated Android build configuration (Gradle 8.4, AndroidX libraries, Java 17)
- Updated iOS dependencies (iOS 12.0 minimum, FBAudienceNetwork 6.14.0)
- Updated Dart SDK constraints and dependencies

## 1.0.1

- Support Android V2 embedding - PR by @anil-shrestha

## 1.0.0-nullsafety.0

- Add nullsafety - PR by @RR-Reddy
- Add support for iOSAdvertiserTrackingEnabled flag - default: false

## 0.9.0

- Bumped up Audience Network SDK to v6.3.0

## 0.8.0
Expand Down
38 changes: 32 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,65 @@ version '1.0-SNAPSHOT'
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.6.0'
classpath 'com.android.tools.build:gradle:8.1.0'
}
}

rootProject.allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven { url "https://maven.facebook.com/maven2/" }
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion 28
compileSdkVersion 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

defaultConfig {
minSdkVersion 16
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
abortOnError false
}
namespace 'com.dsi.facebook_audience_network'
}

// Add specific groovy dependencies
buildscript {
dependencies {
classpath 'org.codehaus.groovy:groovy-all:3.0.17'
classpath 'org.codehaus.groovy:groovy-json:3.0.17'
classpath 'org.codehaus.groovy:groovy-xml:3.0.17'
}
}

// Fix for NoClassDefFoundError
configurations.all {
resolutionStrategy {
force 'org.codehaus.groovy:groovy-all:3.0.17'
force 'org.codehaus.groovy:groovy:3.0.17'
force 'org.codehaus.groovy:groovy-json:3.0.17'
}
}

dependencies {
implementation 'androidx.lifecycle:lifecycle-runtime:2.2.0'
implementation 'androidx.lifecycle:lifecycle-runtime:2.6.2'
implementation 'com.facebook.android:audience-network-sdk:6.+'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.annotation:annotation:1.7.1'
compileOnly files('tempLibs/flutter.jar')
}
10 changes: 8 additions & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.daemon=true
org.gradle.configuration-cache=false
android.useAndroidX=true
android.enableJetifier=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
13 changes: 12 additions & 1 deletion example/.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@
# This file should be version controlled and should not be manually edited.

version:
revision: 8661d8aecd626f7f57ccbcb735553edc05a2e713
revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
channel: stable

project_type: app
migration:
platforms:
- platform: root
create_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
base_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
- platform: android
create_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
base_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
- platform: ios
create_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
base_revision: b0366e0a3f089e15fd89c97604ab998fe432fa3c
29 changes: 23 additions & 6 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@ apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 28
namespace "com.dsi.facebook_audience_network_example"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

lintOptions {
disable 'InvalidPackage'
Expand All @@ -34,8 +41,8 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.dsi.facebook_audience_network_example"
minSdkVersion 16
targetSdkVersion 28
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -55,7 +62,17 @@ flutter {
}

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

// Fix for Kotlin version conflicts
configurations.all {
resolutionStrategy {
force 'org.jetbrains.kotlin:kotlin-stdlib:1.8.10'
force 'org.jetbrains.kotlin:kotlin-stdlib-common:1.8.10'
force 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10'
force 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10'
}
}
7 changes: 4 additions & 3 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
Expand All @@ -24,12 +25,12 @@
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
</manifest>
19 changes: 15 additions & 4 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,29 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.6.1'
classpath 'com.android.tools.build:gradle:8.1.0'
}
}

allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "https://maven.facebook.com/maven2/" }
}

// Fix for Kotlin version conflicts
configurations.all {
resolutionStrategy {
force 'org.jetbrains.kotlin:kotlin-stdlib:1.8.10'
force 'org.jetbrains.kotlin:kotlin-stdlib-common:1.8.10'
force 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.10'
force 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10'
}
}
}

Expand All @@ -24,6 +35,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
3 changes: 3 additions & 0 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
org.gradle.configuration-cache=false
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
6 changes: 5 additions & 1 deletion example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down Expand Up @@ -37,5 +37,9 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
30 changes: 22 additions & 8 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ class AdsPageState extends State<AdsPage> {
/// please add your own device testingId
/// (testingId will print in console if you don't provide )
FacebookAudienceNetwork.init(
testingId: "a77955ee-3304-4635-be65-81029b0f5201",
testingId: "a4de0928-9472-4667-94a2-b6af25eee84e",
iOSAdvertiserTrackingEnabled: true,
);

_loadInterstitialAd();
_loadRewardedVideoAd();
// _loadInterstitialAd();
// _loadRewardedVideoAd();
}

void _loadInterstitialAd() {
Expand All @@ -86,7 +86,8 @@ class AdsPageState extends State<AdsPage> {

void _loadRewardedVideoAd() {
FacebookRewardedVideoAd.loadRewardedVideoAd(
placementId: "YOUR_PLACEMENT_ID",
placementId:
"VID_HD_16_9_46S_APP_INSTALL#2312433698835503_2650502525028617",
listener: (result, value) {
print("Rewarded Ad: $result --> $value");
if (result == RewardedVideoAdResult.LOADED) _isRewardedAdLoaded = true;
Expand Down Expand Up @@ -128,7 +129,16 @@ class AdsPageState extends State<AdsPage> {
Flexible(
child: Align(
alignment: Alignment(0, 1.0),
child: _currentAd,
// child: _currentAd,
child: FacebookBannerAd(
// placementId: "YOUR_PLACEMENT_ID",
placementId:
"IMG_16_9_APP_INSTALL#3974078972862037_3976434542626480", //testid
bannerSize: BannerSize.MEDIUM_RECTANGLE,
listener: (result, value) {
print("Banner Ad: $result --> $value");
},
),
),
fit: FlexFit.tight,
flex: 3,
Expand Down Expand Up @@ -158,7 +168,10 @@ class AdsPageState extends State<AdsPage> {
return Padding(
padding: EdgeInsets.all(8),
child: ElevatedButton(
onPressed: onPressed,
onPressed: () {
print("onPressed: $title");
onPressed?.call();
},
child: Text(
title,
textAlign: TextAlign.center,
Expand All @@ -182,12 +195,13 @@ class AdsPageState extends State<AdsPage> {
}

_showBannerAd() {
print("showBannerAd");
setState(() {
_currentAd = FacebookBannerAd(
// placementId: "YOUR_PLACEMENT_ID",
placementId:
"IMG_16_9_APP_INSTALL#2312433698835503_2964944860251047", //testid
bannerSize: BannerSize.STANDARD,
"IMG_16_9_APP_INSTALL#3974078972862037_3976434542626480", //testid
bannerSize: BannerSize.MEDIUM_RECTANGLE,
listener: (result, value) {
print("Banner Ad: $result --> $value");
},
Expand Down
Loading