diff --git a/app/build.gradle b/app/build.gradle index 53dedee..30c2ddd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId 'org.traccar.manager' minSdkVersion 19 targetSdkVersion 33 - versionCode 34 - versionName '3.3' + versionCode 35 + versionName '3.4' multiDexEnabled true } namespace 'org.traccar.manager' @@ -24,11 +24,12 @@ android { } dependencies { - implementation 'com.google.android.material:material:1.6.1' + implementation 'com.google.android.material:material:1.7.0' implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0' implementation 'androidx.preference:preference-ktx:1.2.0' - implementation 'androidx.core:core-ktx:1.8.0' + implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1' + implementation 'androidx.core:core-ktx:1.9.0' implementation 'androidx.biometric:biometric-ktx:1.2.0-alpha05' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" googleImplementation platform('com.google.firebase:firebase-bom:29.0.3') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index f3a178c..33a07cf 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -6,6 +6,7 @@ + = Build.VERSION_CODES.TIRAMISU && + ContextCompat.checkSelfPermission(activity, Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) { + if (!ActivityCompat.shouldShowRequestPermissionRationale(activity, Manifest.permission.POST_NOTIFICATIONS)) { + ActivityCompat.requestPermissions( + activity, + arrayOf(Manifest.permission.POST_NOTIFICATIONS), + REQUEST_PERMISSIONS_NOTIFICATION + ) + } + } broadcastManager.registerReceiver(tokenBroadcastReceiver, IntentFilter(EVENT_TOKEN)) broadcastManager.registerReceiver(eventIdBroadcastReceiver, IntentFilter(EVENT_EVENT)) } @@ -258,6 +268,7 @@ class MainFragment : WebViewFragment() { const val EVENT_EVENT = "eventEvent" const val KEY_TOKEN = "keyToken" private const val REQUEST_PERMISSIONS_LOCATION = 1 + private const val REQUEST_PERMISSIONS_NOTIFICATION = 2 private const val REQUEST_FILE_CHOOSER = 1 } } diff --git a/build.gradle b/build.gradle index 663fcf5..d3490c0 100644 --- a/build.gradle +++ b/build.gradle @@ -1,13 +1,13 @@ buildscript { - ext.kotlin_version = '1.7.0' + ext.kotlin_version = '1.7.20' repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:7.3.1' - classpath 'com.google.gms:google-services:4.3.13' - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1' + classpath 'com.google.gms:google-services:4.3.14' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 567ad65..dcf0f19 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip