Hello devs. Am implementing FCM push notifications...
# android
i
Hello devs. Am implementing FCM push notifications from my android to my ktor server. My intention is to pass the device token to server from the onNewToken method override in my android to the server. The function to send to token to server is a suspend function. Am stack and i don't know how to send token to the server. Your help will be highly appreciated. Below is some of my code snipets
c
it kinda looks like everything should work. 1. you have FirebaseMessaginqService () and override onNewToken. 2. that uses a use case to register, which uses an api to register the token do you have a specific issue? looks good to me
i
Thanks @Colton Idle. I got a way around it. I had forgotten the @AndroidEntryPoint on the class. Working fine. With no error.
f
note that your
registerUserFromToken
is swallowing`CancelationException`
never mind, too early, ignore me
i
I have opted to store the token only in shared prefs and get it when am login in. Just to avoid server errors.