diff --git a/app/src/main/java/io/heckel/ntfy/msg/MessagingService.kt b/app/src/main/java/io/heckel/ntfy/msg/MessagingService.kt index 3811d09..491ed07 100644 --- a/app/src/main/java/io/heckel/ntfy/msg/MessagingService.kt +++ b/app/src/main/java/io/heckel/ntfy/msg/MessagingService.kt @@ -66,6 +66,7 @@ class MessagingService : FirebaseMessagingService() { override fun onNewToken(token: String) { // Called if the FCM registration token is updated // We don't actually use or care about the token, since we're using topics + Log.d(TAG, "Registration token was updated: $token") } override fun onDestroy() { 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 095d2b1..487db92 100644 --- a/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt +++ b/app/src/main/java/io/heckel/ntfy/ui/MainActivity.kt @@ -100,7 +100,17 @@ class MainActivity : AppCompatActivity(), ActionMode.Callback { lastActive = Date().time/1000 ) viewModel.add(subscription) - FirebaseMessaging.getInstance().subscribeToTopic(topic) // FIXME ignores baseUrl + FirebaseMessaging + .getInstance() + .subscribeToTopic(topic) + .addOnCompleteListener { + Log.d(TAG, "Subscribing to topic complete: result=${it.result}, exception=${it.exception}, successful=${it.isSuccessful}") + } + .addOnFailureListener { + Log.e(TAG, "Subscribing to topic failed: $it") + } + + // FIXME ignores baseUrl onSubscriptionItemClick(subscription) // Add to detail view after adding it }