aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--androidApp/build.gradle.kts2
-rw-r--r--androidApp/src/google/java/ManagerMessagingService.kt18
-rw-r--r--androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt16
-rw-r--r--shared/build.gradle.kts21
-rw-r--r--shared/src/androidTest/kotlin/mx/trackermap/TrackerMap/androidTest.kt12
-rw-r--r--shared/src/commonTest/kotlin/mx/trackermap/TrackerMap/commonTest.kt12
-rw-r--r--shared/src/iosTest/kotlin/mx/trackermap/TrackerMap/iosTest.kt12
7 files changed, 17 insertions, 76 deletions
diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts
index 803e563..655676e 100644
--- a/androidApp/build.gradle.kts
+++ b/androidApp/build.gradle.kts
@@ -15,7 +15,7 @@ android {
versionName = "1.3.2"
ndk {
abiFilters.clear()
- abiFilters += listOf("armeabi-v7a", "arm64-v8a")
+ //abiFilters += listOf("armeabi-v7a", "arm64-v8a")
}
}
buildTypes {
diff --git a/androidApp/src/google/java/ManagerMessagingService.kt b/androidApp/src/google/java/ManagerMessagingService.kt
index 9ac4636..ff6c65f 100644
--- a/androidApp/src/google/java/ManagerMessagingService.kt
+++ b/androidApp/src/google/java/ManagerMessagingService.kt
@@ -16,13 +16,15 @@
package mx.trackermap.TrackerMap.android
import android.annotation.SuppressLint
+import android.app.NotificationManager
import android.app.PendingIntent
+import android.content.Context
import android.content.Intent
import android.os.Build
+import androidx.core.app.NotificationCompat
import com.google.firebase.messaging.FirebaseMessagingService
import com.google.firebase.messaging.RemoteMessage
import kotlinx.coroutines.DelicateCoroutinesApi
-import mx.trackermap.TrackerMap.android.shared.Utils
import mx.trackermap.TrackerMap.android.units.UnitsActivity
import kotlin.time.ExperimentalTime
@@ -30,6 +32,18 @@ import kotlin.time.ExperimentalTime
@ExperimentalTime
class ManagerMessagingService : FirebaseMessagingService() {
+ private fun showNotification(context: Context, id: Int, body: String?, pendingIntent: PendingIntent) {
+ val builder = NotificationCompat.Builder(context, context.getString(R.string.notification_channel_id))
+ .setSmallIcon(R.drawable.icon_notify)
+ .setContentTitle(context.getString(R.string.app_name))
+ .setContentText(body)
+ .setAutoCancel(true)
+ .setContentIntent(pendingIntent)
+ (context.getSystemService(NOTIFICATION_SERVICE)
+ as NotificationManager)
+ .notify(id, builder.build())
+ }
+
@SuppressLint("UnspecifiedImmutableFlag")
override fun onMessageReceived(remoteMessage: RemoteMessage) {
super.onMessageReceived(remoteMessage)
@@ -40,7 +54,7 @@ class ManagerMessagingService : FirebaseMessagingService() {
}
val intent = Intent(this, UnitsActivity::class.java)
val pendingIntent = PendingIntent.getActivity(this, 0, intent, flags)
- Utils.showNotification(
+ showNotification(
this,
remoteMessage.hashCode(),
remoteMessage.notification?.body,
diff --git a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt
index ac9673f..dfe0681 100644
--- a/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt
+++ b/androidApp/src/main/java/mx/trackermap/TrackerMap/android/shared/Utils.kt
@@ -17,17 +17,13 @@
*/
package mx.trackermap.TrackerMap.android.shared
-import android.app.NotificationManager
-import android.app.PendingIntent
import android.content.Context
import android.content.Intent
import android.util.Log
import android.view.View
import androidx.appcompat.widget.PopupMenu
-import androidx.core.app.NotificationCompat
import androidx.core.app.ShareCompat
import androidx.core.content.FileProvider
-import com.google.firebase.messaging.FirebaseMessagingService
import mx.trackermap.TrackerMap.android.R
import mx.trackermap.TrackerMap.client.models.MapLayer
import java.io.BufferedOutputStream
@@ -99,17 +95,5 @@ class Utils {
return cacheFile
}
-
- fun showNotification(context: Context, id: Int, body: String?, pendingIntent: PendingIntent) {
- val builder = NotificationCompat.Builder(context, context.getString(R.string.notification_channel_id))
- .setSmallIcon(R.drawable.icon_notify)
- .setContentTitle(context.getString(R.string.app_name))
- .setContentText(body)
- .setAutoCancel(true)
- .setContentIntent(pendingIntent)
- (context.getSystemService(FirebaseMessagingService.NOTIFICATION_SERVICE)
- as NotificationManager)
- .notify(id, builder.build())
- }
}
} \ No newline at end of file
diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts
index 0ecd643..2488cde 100644
--- a/shared/build.gradle.kts
+++ b/shared/build.gradle.kts
@@ -35,23 +35,11 @@ kotlin {
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.3.1")
}
}
- val commonTest by getting {
- dependencies {
- implementation(kotlin("test-common"))
- implementation(kotlin("test-annotations-common"))
- }
- }
val androidMain by getting {
dependencies {
implementation("io.ktor:ktor-client-cio:$ktor_version")
}
}
- val androidTest by getting {
- dependencies {
- implementation(kotlin("test-junit"))
- implementation("junit:junit:4.13.2")
- }
- }
val iosX64Main by getting
val iosArm64Main by getting
//val iosSimulatorArm64Main by getting
@@ -64,15 +52,6 @@ kotlin {
implementation("io.ktor:ktor-client-ios:$ktor_version")
}
}
- val iosX64Test by getting
- val iosArm64Test by getting
- //val iosSimulatorArm64Test by getting
- val iosTest by creating {
- dependsOn(commonTest)
- iosX64Test.dependsOn(this)
- iosArm64Test.dependsOn(this)
- //iosSimulatorArm64Test.dependsOn(this)
- }
}
}
diff --git a/shared/src/androidTest/kotlin/mx/trackermap/TrackerMap/androidTest.kt b/shared/src/androidTest/kotlin/mx/trackermap/TrackerMap/androidTest.kt
deleted file mode 100644
index 9b2af46..0000000
--- a/shared/src/androidTest/kotlin/mx/trackermap/TrackerMap/androidTest.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package mx.trackermap.TrackerMap
-
-import org.junit.Assert.assertTrue
-import org.junit.Test
-
-class AndroidGreetingTest {
-
- @Test
- fun testExample() {
- assertTrue("Check Android is mentioned", Greeting().greeting().contains("Android"))
- }
-} \ No newline at end of file
diff --git a/shared/src/commonTest/kotlin/mx/trackermap/TrackerMap/commonTest.kt b/shared/src/commonTest/kotlin/mx/trackermap/TrackerMap/commonTest.kt
deleted file mode 100644
index 87a789b..0000000
--- a/shared/src/commonTest/kotlin/mx/trackermap/TrackerMap/commonTest.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package mx.trackermap.TrackerMap
-
-import kotlin.test.Test
-import kotlin.test.assertTrue
-
-class CommonGreetingTest {
-
- @Test
- fun testExample() {
- assertTrue(Greeting().greeting().contains("Hello"), "Check 'Hello' is mentioned")
- }
-} \ No newline at end of file
diff --git a/shared/src/iosTest/kotlin/mx/trackermap/TrackerMap/iosTest.kt b/shared/src/iosTest/kotlin/mx/trackermap/TrackerMap/iosTest.kt
deleted file mode 100644
index 5847b1c..0000000
--- a/shared/src/iosTest/kotlin/mx/trackermap/TrackerMap/iosTest.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package mx.trackermap.TrackerMap
-
-import kotlin.test.Test
-import kotlin.test.assertTrue
-
-class IosGreetingTest {
-
- @Test
- fun testExample() {
- assertTrue(Greeting().greeting().contains("iOS"), "Check iOS is mentioned")
- }
-} \ No newline at end of file