feat: Forward notifications to Android Auto
This commit is contained in:
parent
2d240ccda3
commit
40bd7eed91
6 changed files with 13 additions and 2 deletions
|
|
@ -14,6 +14,7 @@ if (file("google-services.json").exists()) {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4") // For flutter_local_notifications // Workaround for: https://github.com/MaikuB/flutter_local_notifications/issues/2286
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4") // For flutter_local_notifications // Workaround for: https://github.com/MaikuB/flutter_local_notifications/issues/2286
|
||||||
|
implementation("androidx.core:core-ktx:1.17.0") // For Android Auto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,11 @@
|
||||||
<!-- From flutter_local_notifications package for notification actions -->
|
<!-- From flutter_local_notifications package for notification actions -->
|
||||||
<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ActionBroadcastReceiver" />
|
<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ActionBroadcastReceiver" />
|
||||||
|
|
||||||
|
<!-- To make notifications available in Android Auto -->
|
||||||
|
<meta-data
|
||||||
|
android:name="com.google.android.gms.car.application"
|
||||||
|
android:resource="@xml/automotive_app_desc"/>
|
||||||
|
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
<meta-data
|
<meta-data
|
||||||
|
|
|
||||||
3
android/app/src/main/res/xml/automotive_app_desc.xml
Normal file
3
android/app/src/main/res/xml/automotive_app_desc.xml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<automotiveApp>
|
||||||
|
<uses name="notification" />
|
||||||
|
</automotiveApp>
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#Mon Mar 17 08:36:03 CET 2025
|
#Mon Mar 17 08:36:03 CET 2025
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ pluginManagement {
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||||
id("com.android.application") version "8.7.3" apply false
|
id("com.android.application") version "8.9.1" apply false
|
||||||
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
|
id("org.jetbrains.kotlin.android") version "2.1.0" apply false
|
||||||
if (file("app/google-services.json").exists()) {
|
if (file("app/google-services.json").exists()) {
|
||||||
id("com.google.gms.google-services") version "4.3.8" apply false
|
id("com.google.gms.google-services") version "4.3.8" apply false
|
||||||
|
|
|
||||||
|
|
@ -289,10 +289,12 @@ Future<void> _tryPushHelper(
|
||||||
],
|
],
|
||||||
cancelNotification: false,
|
cancelNotification: false,
|
||||||
allowGeneratedReplies: true,
|
allowGeneratedReplies: true,
|
||||||
|
semanticAction: SemanticAction.reply,
|
||||||
),
|
),
|
||||||
AndroidNotificationAction(
|
AndroidNotificationAction(
|
||||||
FluffyChatNotificationActions.markAsRead.name,
|
FluffyChatNotificationActions.markAsRead.name,
|
||||||
l10n.markAsRead,
|
l10n.markAsRead,
|
||||||
|
semanticAction: SemanticAction.markAsRead,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue