diff --git a/app/src/main/java/io/heckel/ntfy/msg/ApiService.kt b/app/src/main/java/io/heckel/ntfy/msg/ApiService.kt index 1152f0a..2bea4c1 100644 --- a/app/src/main/java/io/heckel/ntfy/msg/ApiService.kt +++ b/app/src/main/java/io/heckel/ntfy/msg/ApiService.kt @@ -157,6 +157,9 @@ class ApiService { companion object { private const val TAG = "NtfyApiService" + + // These constants have corresponding values in the server codebase! + const val CONTROL_TOPIC = "~control" const val EVENT_MESSAGE = "message" const val EVENT_KEEPALIVE = "keepalive" } diff --git a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt index 22def38..a1b9a9e 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt @@ -117,7 +117,7 @@ class MainActivity : AppCompatActivity(), ActionMode.Callback, AddFragment.Subsc notifier!!.createNotificationChannels() // Subscribe to control Firebase channel (so we can re-start the foreground service if it dies) - messenger.subscribe("~keepalive") + messenger.subscribe(ApiService.CONTROL_TOPIC) // Background things startPeriodicPollWorker()