RestComm / restcomm-android-sdk

Android Mobile SDK to easily integrate communication features (WebRTC, messaging, presence, voice, video, screensharing) based on RestComm into native Mobile Applications
http://www.restcomm.com/
GNU Affero General Public License v3.0
153 stars 109 forks source link

Start background service only if message timer is 0 #823

Closed ognjenns closed 6 years ago

ognjenns commented 6 years ago

When we receive messages while the app is in the background, we are starting the service in foreground. When service's onStartCommand is called, we need to call startForeground with notification. Notification data is: Title: Restcomm Connect Message: Background initialization...

When we are connected to Restcomm, we are replacing an existing notification with the "Message" notification or "Call" notification.

For the messages, while phone is locked, when we receive push we get something like:

  1. message: Background initialization... Hey Oggie test
  2. message: Background initialization... Hey Oggie test 2

... The idea is to not starting the service if message counter is > 0