node.js - Android Chat Push Notifications Socket.Io NodeJS Server -
i built nodejs based chat server socket.io underlying library. chat client in android app , uses https://github.com/socketio/socket.io-client-java
currently, push notifications determined based on number of sockets connected. (1:1 chat, ideally, if there 2 , implies both available)
i subscribe whenever open chat window or comes focus after going out, disconnect whenever move out of chat window or window goes out of focus.
cases handle are: 1. app closed 2. app open user on other app 3. user on app elsewhere not on chat windows 4. user on chat summary window 5. user on 1:1 chat - notifs shouldn't come chats on window 6. user on 1:1 - should push notifs chats else
1 case pending main bug - if user on app , on chat window, closes app, socket connection still alive activity not cleaning entirely. causes subsequent runs break push notifs.
what best way resolve ? other solutions ?
Comments
Post a Comment