Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android push notification without Google service

I am from Apple world, so I don't have much experience with Android.

But what I am looking is a way that Android devices receive push notification, without using any third party servers. Notification need to be standard Android notification (look and feel)

The reason I need this is, because I would need this in a room that does not have access to outer world. (can't connect to any server) But I have my own WiFi so users can receive push notification from my server via my wifi.

I know that on iOS this is not possible, what about Android?

like image 812
Marko Zadravec Avatar asked Nov 24 '16 12:11

Marko Zadravec


1 Answers

it is possible using Service left running in system (background) after app exit. some samples HERE, you should be interested in START_STICKY flag

you have to keep some connection (socket?) or interval requesting (not so well, but possible) inside your Service. Google Services (including Firebase) does that by itself and "redeliver" received push messages to properly declared (in manifest) app

like image 153
snachmsm Avatar answered Oct 21 '22 08:10

snachmsm