Skip to content

Commit 9969374

Browse files
authored
Merge pull request #46 from webreinvent/feature/upgrade-flutter-to-3.24.3-and-dependencies
Feature -> Develop | Upgrade Flutter to 3.24.3 and Project Dependencies
2 parents 94c5501 + 63d2e75 commit 9969374

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2031
-1181
lines changed

android/app/build.gradle

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,15 +22,15 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
android {
29-
compileSdkVersion 33
30-
ndkVersion flutter.ndkVersion
26+
namespace 'com.webreinvent.vaahflutter'
27+
28+
compileSdkVersion 34
29+
ndkVersion "26.1.10909125"
3130

3231
compileOptions {
32+
// TODO: coreLibraryDesugaringEnabled true is required for local notification
33+
coreLibraryDesugaringEnabled true
3334
sourceCompatibility JavaVersion.VERSION_1_8
3435
targetCompatibility JavaVersion.VERSION_1_8
3536
}
@@ -47,10 +48,11 @@ android {
4748
applicationId "com.webreinvent.vaahflutter"
4849
// You can update the following values to match your application needs.
4950
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
50-
minSdkVersion 19
51+
minSdkVersion flutter.minSdkVersion
5152
targetSdkVersion flutter.targetSdkVersion
5253
versionCode flutterVersionCode.toInteger()
5354
versionName flutterVersionName
55+
multiDexEnabled true
5456
}
5557

5658
buildTypes {
@@ -67,5 +69,6 @@ flutter {
6769
}
6870

6971
dependencies {
70-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
72+
implementation "androidx.multidex:multidex:2.0.1"
73+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
7174
}

android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.webreinvent.vaahflutter">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<!-- The INTERNET permission is required for development. Specifically,
43
the Flutter tool needs it to communicate with the running application
54
to allow setting breakpoints, to provide hot reload, etc.

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.webreinvent.vaahflutter">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<application
43
android:label="VaahFlutter"
54
android:name="${applicationName}"

android/app/src/profile/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.webreinvent.vaahflutter">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<!-- The INTERNET permission is required for development. Specifically,
43
the Flutter tool needs it to communicate with the running application
54
to allow setting breakpoints, to provide hot reload, etc.

android/build.gradle

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
buildscript {
2-
ext.kotlin_version = '1.6.10'
3-
repositories {
4-
google()
5-
mavenCentral()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.2'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
174
mavenCentral()
185
}
6+
7+
subprojects {
8+
afterEvaluate { project ->
9+
if (project.hasProperty('android')) {
10+
project.android {
11+
if (namespace == null) {
12+
namespace project.group
13+
}
14+
}
15+
}
16+
}
17+
}
1918
}
2019

2120
rootProject.buildDir = '../build'

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Tue Oct 22 12:58:24 IST 2024
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
35
zipStoreBase=GRADLE_USER_HOME
46
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

android/settings.gradle

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
// {agpVersion}
22+
id "com.android.application" version '8.6.1' apply false
23+
// {kotlinVersion}
24+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
25+
}
26+
27+
include ":app"

ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>NSExtension</key>
6+
<dict>
7+
<key>NSExtensionPointIdentifier</key>
8+
<string>com.apple.usernotifications.service</string>
9+
<key>NSExtensionPrincipalClass</key>
10+
<string>$(PRODUCT_MODULE_NAME).NotificationService</string>
11+
</dict>
12+
</dict>
13+
</plist>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import UserNotifications
2+
3+
import OneSignalExtension
4+
5+
class NotificationService: UNNotificationServiceExtension {
6+
7+
var contentHandler: ((UNNotificationContent) -> Void)?
8+
var receivedRequest: UNNotificationRequest!
9+
var bestAttemptContent: UNMutableNotificationContent?
10+
11+
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
12+
self.receivedRequest = request
13+
self.contentHandler = contentHandler
14+
self.bestAttemptContent = (request.content.mutableCopy() as? UNMutableNotificationContent)
15+
16+
if let bestAttemptContent = bestAttemptContent {
17+
/* DEBUGGING: Uncomment the 2 lines below to check this extension is executing
18+
Note, this extension only runs when mutable-content is set
19+
Setting an attachment or action buttons automatically adds this */
20+
// print("Running NotificationServiceExtension")
21+
// bestAttemptContent.body = "[Modified] " + bestAttemptContent.body
22+
23+
OneSignalExtension.didReceiveNotificationExtensionRequest(self.receivedRequest, with: bestAttemptContent, withContentHandler: self.contentHandler)
24+
}
25+
}
26+
27+
override func serviceExtensionTimeWillExpire() {
28+
// Called just before the extension will be terminated by the system.
29+
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
30+
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
31+
OneSignalExtension.serviceExtensionTimeWillExpireRequest(self.receivedRequest, with: self.bestAttemptContent)
32+
contentHandler(bestAttemptContent)
33+
}
34+
}
35+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>com.apple.security.application-groups</key>
6+
<array>
7+
<string>group.com.webreinvent.vaahflutter.onesignal</string>
8+
</array>
9+
</dict>
10+
</plist>

ios/Podfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ post_install do |installer|
3939
flutter_additional_ios_build_settings(target)
4040
end
4141
end
42+
43+
target 'OneSignalNotificationServiceExtension' do
44+
use_frameworks!
45+
pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'
46+
end

0 commit comments

Comments
 (0)