From deff7c0f81ceaa6afd5e20155323de320a275f2f Mon Sep 17 00:00:00 2001 From: koalasat Date: Wed, 6 Nov 2024 18:43:32 +0100 Subject: [PATCH] Fix start servuce --- app/src/main/java/com/koalasat/pokey/models/NostrClient.kt | 2 -- .../java/com/koalasat/pokey/service/NotificationsService.kt | 4 +++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/koalasat/pokey/models/NostrClient.kt b/app/src/main/java/com/koalasat/pokey/models/NostrClient.kt index f9eeb52..04b3ffa 100644 --- a/app/src/main/java/com/koalasat/pokey/models/NostrClient.kt +++ b/app/src/main/java/com/koalasat/pokey/models/NostrClient.kt @@ -213,7 +213,6 @@ object NostrClient { private fun getInboxLists(context: Context) { val hexKey = Pokey.getInstance().getHexKey() if (hexKey.isEmpty()) return - Log.d("Pokey", "getInboxLists") Client.sendFilterAndStopOnFirstResponse( subscriptionReadId, @@ -267,7 +266,6 @@ object NostrClient { } private fun manageInboxRelays(context: Context, event: Event) { - Log.d("Pokey", event.kind.toString()) val db = AppDatabase.getDatabase(context, Pokey.getInstance().getHexKey()) val lastCreatedRelayAt = db.applicationDao().getLatestRelaysByKind(event.kind) diff --git a/app/src/main/java/com/koalasat/pokey/service/NotificationsService.kt b/app/src/main/java/com/koalasat/pokey/service/NotificationsService.kt index ebd6198..1f4d9a1 100644 --- a/app/src/main/java/com/koalasat/pokey/service/NotificationsService.kt +++ b/app/src/main/java/com/koalasat/pokey/service/NotificationsService.kt @@ -168,6 +168,8 @@ class NotificationsService : Service() { startForeground(1, createNotification()) keepAlive() + startSubscription() + val connectivityManager = (getSystemService(ConnectivityManager::class.java) as ConnectivityManager) connectivityManager.registerDefaultNetworkCallback(networkCallback) @@ -213,7 +215,7 @@ class NotificationsService : Service() { NostrClient.checkRelaysHealth(this@NotificationsService) } }, - 3000, + 5000, 61000, ) }