Switch to ~control for control channel

This commit is contained in:
Philipp Heckel 2021-12-13 21:10:48 -05:00
parent 58b56383dc
commit 957c351c96
2 changed files with 4 additions and 1 deletions

View file

@ -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"
}

View file

@ -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()