Add logs
This commit is contained in:
parent
4513b9963e
commit
a51c856d4c
2 changed files with 12 additions and 1 deletions
|
@ -66,6 +66,7 @@ class MessagingService : FirebaseMessagingService() {
|
||||||
override fun onNewToken(token: String) {
|
override fun onNewToken(token: String) {
|
||||||
// Called if the FCM registration token is updated
|
// Called if the FCM registration token is updated
|
||||||
// We don't actually use or care about the token, since we're using topics
|
// 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() {
|
override fun onDestroy() {
|
||||||
|
|
|
@ -100,7 +100,17 @@ class MainActivity : AppCompatActivity(), ActionMode.Callback {
|
||||||
lastActive = Date().time/1000
|
lastActive = Date().time/1000
|
||||||
)
|
)
|
||||||
viewModel.add(subscription)
|
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
|
onSubscriptionItemClick(subscription) // Add to detail view after adding it
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue