File tree Expand file tree Collapse file tree 8 files changed +71
-22
lines changed
lib/services/notification Expand file tree Collapse file tree 8 files changed +71
-22
lines changed Original file line number Diff line number Diff line change @@ -84,4 +84,6 @@ flutter {
8484
8585dependencies {
8686 coreLibraryDesugaring ' com.android.tools:desugar_jdk_libs:1.2.2'
87+ implementation ' androidx.window:window:1.0.0'
88+ implementation ' androidx.window:window-java:1.0.0'
8789}
Original file line number Diff line number Diff line change 1- -keep class androidx.lifecycle.** { *; }
1+ -keep class androidx.lifecycle.** { *; }
2+
3+ ## Gson rules
4+ # Gson uses generic type information stored in a class file when working with fields. Proguard
5+ # removes such information by default, so configure it to keep all of it.
6+ -keepattributes Signature
7+
8+ # For using GSON @Expose annotation
9+ -keepattributes *Annotation*
10+
11+ # Gson specific classes
12+ -dontwarn sun.misc.**
13+ #-keep class com.google.gson.stream.** { *; }
14+
15+ # Prevent proguard from stripping interface information from TypeAdapter, TypeAdapterFactory,
16+ # JsonSerializer, JsonDeserializer instances (so they can be used in @JsonAdapter)
17+ -keep class * extends com.google.gson.TypeAdapter
18+ -keep class * implements com.google.gson.TypeAdapterFactory
19+ -keep class * implements com.google.gson.JsonSerializer
20+ -keep class * implements com.google.gson.JsonDeserializer
21+
22+ # Prevent R8 from leaving Data object members always null
23+ -keepclassmembers,allowobfuscation class * {
24+ @com.google.gson.annotations.SerializedName <fields>;
25+ }
26+
27+ # Retain generic signatures of TypeToken and its subclasses with R8 version 3.0 and higher.
28+ -keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
29+ -keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken
Original file line number Diff line number Diff line change 11<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
22 xmlns : tools =" http://schemas.android.com/tools" >
3+ <uses-permission android : name =" android.permission.RECEIVE_BOOT_COMPLETED" />
4+ <uses-permission android : name =" android.permission.VIBRATE" />
5+ <uses-permission android : name =" android.permission.USE_FULL_SCREEN_INTENT" />
6+ <uses-permission android : name =" android.permission.POST_NOTIFICATIONS" />
7+ <uses-permission android : name =" android.permission.FOREGROUND_SERVICE" />
38 <application
49 android : label =" Flutter UI Designs"
510 android : name =" ${applicationName}"
1924 android : theme =" @style/LaunchTheme"
2025 android : configChanges =" orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
2126 android : hardwareAccelerated =" true"
27+ android : showWhenLocked =" true"
28+ android : turnScreenOn =" true"
2229 android : windowSoftInputMode =" adjustResize" >
2330 <!-- Specifies an Android theme to apply to this Activity as soon as
2431 the Android process has started. This theme is visible to the user
Original file line number Diff line number Diff line change @@ -8,14 +8,14 @@ class LocalNotification {
88 android: AndroidInitializationSettings (
99 '@mipmap/ic_launcher' ,
1010 ),
11- iOS: DarwinInitializationSettings (
12- onDidReceiveLocalNotification:
13- LocalNotification .onDidReceiveLocalNotification,
14- ),
15- macOS: DarwinInitializationSettings (
16- onDidReceiveLocalNotification:
17- LocalNotification .onDidReceiveLocalNotification,
18- ),
11+ // iOS: DarwinInitializationSettings(
12+ // onDidReceiveLocalNotification:
13+ // LocalNotification.onDidReceiveLocalNotification,
14+ // ),
15+ // macOS: DarwinInitializationSettings(
16+ // onDidReceiveLocalNotification:
17+ // LocalNotification.onDidReceiveLocalNotification,
18+ // ),
1919 );
2020
2121 LocalNotification .ins.initialize (
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ class AppFCM {
1717 static Future <void > init () async {
1818 LocalNotification .init ();
1919 // FirebaseMessaging.onBackgroundMessage(_onBackgroundMessageHandler);
20- if ( Platform .isIOS) {
21- await _requestPermission ();
22- }
20+
21+ await _requestPermission ();
22+
2323 await AppFCM .ins.setForegroundNotificationPresentationOptions (
2424 alert: true ,
2525 badge: true ,
@@ -39,19 +39,22 @@ class AppFCM {
3939
4040 static void _foregroundState () {
4141 FirebaseMessaging .onMessage.listen ((RemoteMessage message) async {
42+ print ("foreground onMessage: $message " );
4243 LocalNotification .showNotification (message);
4344 });
4445 }
4546
4647 static void _backgroundState () {
4748 FirebaseMessaging .onMessageOpenedApp.listen ((RemoteMessage message) async {
49+ print ("background onMessageOpenedApp: $message " );
4850 LocalNotification .handleNotificationAction (message.data);
4951 });
5052 }
5153
5254 static void handleTerminated () async {
5355 // final message = await Future.value("");
5456 final message = await AppFCM .ins.getInitialMessage ();
57+ print ("handleTerminated: $message " );
5558 if (message == null ) return ;
5659
5760 LocalNotification .handleNotificationAction (message.data);
Original file line number Diff line number Diff line change @@ -367,26 +367,34 @@ packages:
367367 dependency: "direct main"
368368 description:
369369 name: flutter_local_notifications
370- sha256: c500d5d9e7e553f06b61877ca6b9c8b92c570a4c8db371038702e8ce57f8a50f
370+ sha256: "6c80fa47c9a2d85bf9c3926fb614feab194a8dd267d009b16dc9c52cbdd01712"
371371 url: "https://pub.dev"
372372 source: hosted
373- version: "17.2.2 "
373+ version: "19.0.0-dev.1 "
374374 flutter_local_notifications_linux:
375375 dependency: transitive
376376 description:
377377 name: flutter_local_notifications_linux
378- sha256: c49bd06165cad9beeb79090b18cd1eb0296f4bf4b23b84426e37dd7c027fc3af
378+ sha256: "265340ee321634e7cc11c740252cf8ba71dc5ffaf33e8c5da0ee4d1465d5a3eb"
379379 url: "https://pub.dev"
380380 source: hosted
381- version: "4.0 .1"
381+ version: "5.0.1-dev .1"
382382 flutter_local_notifications_platform_interface:
383383 dependency: transitive
384384 description:
385385 name: flutter_local_notifications_platform_interface
386- sha256: "85f8d07fe708c1bdcf45037f2c0109753b26ae077e9d9e899d55971711a4ea66 "
386+ sha256: "2e387899e2bf22a6e5de22c719701a067521c6f7a810d3b0fbb8bfaf5a2771c7 "
387387 url: "https://pub.dev"
388388 source: hosted
389- version: "7.2.0"
389+ version: "8.1.0-dev.1"
390+ flutter_local_notifications_windows:
391+ dependency: transitive
392+ description:
393+ name: flutter_local_notifications_windows
394+ sha256: "0888485c7778ad5c69943831b5708edd141e8d745af219809b3d107ba7892522"
395+ url: "https://pub.dev"
396+ source: hosted
397+ version: "1.0.0-dev.1"
390398 flutter_localizations:
391399 dependency: "direct main"
392400 description: flutter
@@ -1021,10 +1029,10 @@ packages:
10211029 dependency: transitive
10221030 description:
10231031 name: timezone
1024- sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d"
1032+ sha256: ffc9d5f4d1193534ef051f9254063fa53d588609418c84299956c3db9383587d
10251033 url: "https://pub.dev"
10261034 source: hosted
1027- version: "0.9.4 "
1035+ version: "0.10.0 "
10281036 tinycolor2:
10291037 dependency: "direct main"
10301038 description:
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ dependencies:
4242 url_launcher : 6.3.0
4343 google_mobile_ads : 5.1.0
4444 package_info_plus : 8.1.1
45- flutter_local_notifications : 17.2.2
45+ flutter_local_notifications : 19.0.0-dev.1
4646
4747 faker : 2.2.0
4848 emojis : 0.9.9
@@ -82,7 +82,7 @@ dev_dependencies:
8282 glob : 2.1.2
8383 yaml : 3.1.2
8484 translator : 1.0.0
85- flutter_launcher_icons : " ^ 0.14.1"
85+ flutter_launcher_icons : 0.14.1
8686
8787flutter :
8888 uses-material-design : true
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ list(APPEND FLUTTER_PLUGIN_LIST
99)
1010
1111list (APPEND FLUTTER_FFI_PLUGIN_LIST
12+ flutter_local_notifications_windows
1213)
1314
1415set (PLUGIN_BUNDLED_LIBRARIES)
You can’t perform that action at this time.
0 commit comments