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
Colton Idle
07/27/2023, 2:51 PM
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
IsaacMart
07/27/2023, 2:57 PM
Thanks @Colton Idle. I got a way around it. I had forgotten the @AndroidEntryPoint on the class. Working fine. With no error.
f
Francesc
07/27/2023, 3:06 PM
note that your
registerUserFromToken
is swallowing`CancelationException`
never mind, too early, ignore me
i
IsaacMart
07/27/2023, 3:11 PM
I have opted to store the token only in shared prefs and get it when am login in. Just to avoid server errors.