Android Question how to create stable services without Nofitications

alis1200

Member
hi
i am trying to create chat app with sockets, and my app have one service that show notification when new text emmited in my server.
the service should be stable and start in boot, for create stable service i define two method:
1- add #StartCommandReturnValue: android.app.Service.START_STICKY in the #Region Service Attributes
2- add Service.AutomaticForegroundMode = Service.AUTOMATIC_FOREGROUND_NEVER in Sub Service_Create
both ways creating one notification that means service worked in background.
for chat app ungrateful that always show one notification.
i want to create the stable service without show any notifications.
if you suggest the 2nd way, say quite detail for me please.
excuse me for mistakes in my thread, my language not english.
best Regards
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
1- add #StartCommandReturnValue: android.app.Service.START_STICKY in the #Region Service Attributes
Why???
Search the forum for START_STICKY. Go to the first result and read the first line:
" Edit: Things have changed with newer versions of Android and new restrictions. Sticky services should not be used any more. "

i want to create the stable service without show any notifications.
Not possible. You should use push notifications.
 
Upvote 0

alis1200

Member
can i use push notifications whitout use firebase service?
i am using SocketIOClient library.
how to use push notifications?
 
Upvote 0
Top