From 7afcf6a37b12ec8d9ad3f7276cafdc698e48510a Mon Sep 17 00:00:00 2001 From: Imran Remtulla Date: Thu, 25 Aug 2022 15:29:25 -0400 Subject: [PATCH] Fixed notif icon + Updated plugins + build warning --- android/app/build.gradle | 4 ++-- android/app/src/main/res/raw/keep.xml | 3 +++ lib/main.dart | 17 +++++------------ pubspec.lock | 12 ++++++------ pubspec.yaml | 2 +- 5 files changed, 17 insertions(+), 21 deletions(-) create mode 100644 android/app/src/main/res/raw/keep.xml diff --git a/android/app/build.gradle b/android/app/build.gradle index fe6842c..09eb008 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -32,7 +32,7 @@ if (keystorePropertiesFile.exists()) { } android { - compileSdkVersion flutter.compileSdkVersion + compileSdkVersion 33 ndkVersion flutter.ndkVersion compileOptions { @@ -54,7 +54,7 @@ android { // You can update the following values to match your application needs. // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration. minSdkVersion 23 - targetSdkVersion 32 + targetSdkVersion 33 versionCode flutterVersionCode.toInteger() versionName flutterVersionName } diff --git a/android/app/src/main/res/raw/keep.xml b/android/app/src/main/res/raw/keep.xml new file mode 100644 index 0000000..c721bb9 --- /dev/null +++ b/android/app/src/main/res/raw/keep.xml @@ -0,0 +1,3 @@ + + \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index cb91c4a..48c891c 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:obtainium/pages/home.dart'; import 'package:obtainium/services/apps_provider.dart'; import 'package:obtainium/services/settings_provider.dart'; @@ -95,18 +96,10 @@ class MyApp extends StatelessWidget { settingsProvider.initializeSettings().then((_) { bool isFirstRun = settingsProvider.checkAndFlipFirstRun(); if (isFirstRun) { - appsProvider - .notify( - 3, - 'Permission Notification', - 'This is a transient notification used to trigger the Android 13 notification permission prompt', - 'PERMISSION_NOTIFICATION', - 'Permission Notifications', - 'A transient notification used to trigger the Android 13 notification permission prompt', - important: false) - .whenComplete(() { - appsProvider.downloaderNotifications.cancel(3); - }); + appsProvider.downloaderNotifications + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin>()! + .requestPermission(); appsProvider.saveApp(App( 'imranr98_obtainium_github', 'https://github.com/ImranR98/Obtainium', diff --git a/pubspec.lock b/pubspec.lock index 86e0978..1a79137 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -91,7 +91,7 @@ packages: name: dbus url: "https://pub.dartlang.org" source: hosted - version: "0.7.7" + version: "0.7.8" dynamic_color: dependency: "direct main" description: @@ -119,7 +119,7 @@ packages: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.2" + version: "6.1.4" flutter: dependency: "direct main" description: flutter @@ -152,7 +152,7 @@ packages: name: flutter_local_notifications url: "https://pub.dartlang.org" source: hosted - version: "9.7.0" + version: "9.8.0+1" flutter_local_notifications_linux: dependency: transitive description: @@ -281,7 +281,7 @@ packages: name: path_provider_android url: "https://pub.dartlang.org" source: hosted - version: "2.0.17" + version: "2.0.20" path_provider_ios: dependency: transitive description: @@ -552,7 +552,7 @@ packages: name: webview_flutter_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "1.9.1" + version: "1.9.2" webview_flutter_wkwebview: dependency: transitive description: @@ -580,7 +580,7 @@ packages: name: xdg_directories url: "https://pub.dartlang.org" source: hosted - version: "0.2.0+1" + version: "0.2.0+2" xml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 033991f..3f6c067 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -38,7 +38,7 @@ dependencies: cupertino_icons: ^1.0.2 path_provider: ^2.0.11 flutter_fgbg: ^0.2.0 # Try removing reliance on this - flutter_local_notifications: ^9.7.0 + flutter_local_notifications: ^9.8.0+1 provider: ^6.0.3 http: ^0.13.5 webview_flutter: ^3.0.4