Using Socket in Android application for non-google certified devices

31 Views Asked by At

I am working on an application for a non-google certified device which means it doesn't have google play services or FCM, I am trying to implement push notifications using Socket.

I have already implemented it using Stomp Protocol StompProtocolAndroid and SpringBoot stomp-websocket and it is working as expected when implemented it inside an activity or inside the application class.

My question is: What is the best way to always have an open socket in the background receiving messages from the server to show notifications all the time even if the application is not running?

I have tried the WorkManager and old-school Service class, is there a better way?

0

There are 0 best solutions below