google-developer-training / advanced-android-kotlin-notifications-fcm

Other
20 stars 56 forks source link

Advanced Android in Kotlin: Firebase Messaging 1.2 [Step #][description] #14

Open hhyeok1026 opened 2 years ago

hhyeok1026 commented 2 years ago

Describe the problem A clear and concise description of what the problem is.

The following error lint occurs in MyFirebaseMessagingService.kt file, The build fails. => 'onMessageReceived' overrides nothing 'onNewToken' overrides nothing

In my case, I changed fcm message to the latest version,

When looking at the FirebaseMessagingService file that inherits from MyFirebaseMessagingService class, The method takes a nonnull parameter.

solution So the overriding method, You need to remove the nullable question marks in onMessageReceived and onNewToken.