@@ -46,7 +46,7 @@ class FcmService : FirebaseMessagingService() {
4646 * Act on received messages. [Debug](https://goo.gl/39bRNJ)
4747 */
4848 override fun onMessageReceived (message : RemoteMessage ) {
49- Logger .debug(" New FCM at: ${Date (message.sentTime)} " )
49+ Logger .debug(" New FCM at: ${Date (message.sentTime)} " , context = TAG )
5050
5151 message.notification?.run {
5252 Logger .debug(" FCM title: $title " )
@@ -63,7 +63,7 @@ class FcmService : FirebaseMessagingService() {
6363 }
6464 isEncryptedNotification
6565 }.getOrElse {
66- Logger .error(" Failed to read encrypted notification payload" , it)
66+ Logger .error(" Failed to read encrypted notification payload" , it, context = TAG )
6767 // Let the node to spin up and handle incoming events
6868 true
6969 }
@@ -90,21 +90,21 @@ class FcmService : FirebaseMessagingService() {
9090 }
9191
9292 private fun handleNow (data : Map <String , String >) {
93- Logger .warn(" FCM handler not implemented for: $data " )
93+ Logger .warn(" FCM handler not implemented for: $data " , context = TAG )
9494 }
9595
9696 private fun decryptPayload (response : EncryptedNotification ) {
9797 val ciphertext = runCatching { response.cipher.fromBase64() }.getOrElse {
98- Logger .error(" Failed to decode cipher" , it)
98+ Logger .error(" Failed to decode cipher" , it, context = TAG )
9999 return
100100 }
101101 val privateKey = runCatching { keychain.load(Keychain .Key .PUSH_NOTIFICATION_PRIVATE_KEY .name)!! }.getOrElse {
102- Logger .error(" Missing PUSH_NOTIFICATION_PRIVATE_KEY" , it)
102+ Logger .error(" Missing PUSH_NOTIFICATION_PRIVATE_KEY" , it, context = TAG )
103103 return
104104 }
105105 val password =
106106 runCatching { crypto.generateSharedSecret(privateKey, response.publicKey, DERIVATION_NAME ) }.getOrElse {
107- Logger .error(" Failed to generate shared secret" , it)
107+ Logger .error(" Failed to generate shared secret" , it, context = TAG )
108108 return
109109 }
110110
@@ -114,20 +114,20 @@ class FcmService : FirebaseMessagingService() {
114114 )
115115
116116 val decoded = decrypted.decodeToString()
117- Logger .debug(" Decrypted payload: $decoded " )
117+ Logger .debug(" Decrypted payload: $decoded " , context = TAG )
118118
119119 val (payload, type) = runCatching { json.decodeFromString<DecryptedNotification >(decoded) }.getOrElse {
120- Logger .error(" Failed to decode decrypted data" , it)
120+ Logger .error(" Failed to decode decrypted data" , it, context = TAG )
121121 return
122122 }
123123
124124 if (payload == null ) {
125- Logger .error(" Missing payload" )
125+ Logger .error(" Missing payload" , context = TAG )
126126 return
127127 }
128128
129129 if (type == null ) {
130- Logger .error(" Missing type" )
130+ Logger .error(" Missing type" , context = TAG )
131131 return
132132 }
133133
0 commit comments