0

Will notifications be delayed? I'm using Firebase to notify me of incoming calls. In rare cases, notifications appear to arrive late in the app. I want to detect whether the incoming call notification was successful. Is there an API for that? Clients are iOS and Android applications.

Thanks,takanao

takanao
  • 1
  • 2

1 Answers1

1

I had a similar use-case once and this was the exact issue we face, but sorry to say this happens sometimes. I am quoting this from the official docs

FCM usually delivers messages immediately after they are sent. However, this might not always be possible. For example, if the platform is Android, the device could be turned off, offline, or otherwise unavailable. Or FCM might intentionally delay messages to prevent an app from consuming excessive resources and negatively affecting battery life.

When this happens, FCM stores the message and delivers it as soon as it's feasible. While this is fine in most cases, there are some apps for which a late message might as well never be delivered. For example, if the message is an incoming call or video chat notification, it is meaningful only for a short period of time before the call is terminated. Or if the message is an invitation to an event, it is useless if received after the event has ended.

On Android and Web/JavaScript, you can specify the maximum lifespan of a message. The value must be a duration from 0 to 2,419,200 seconds (28 days), and it corresponds to the maximum period of time for which FCM stores and attempts to deliver the message. Requests that don't contain this field default to the maximum period of four weeks.

So I would suggest you are better off if possible to implement some other means for this like Socket connection or something. As far as I know there is no way of knowing if the Notification reach the user's device that is iOS or Android. We do get an OK or Success response when send the message, but whether they reach or not is a different thing.

You should check that link and reduce the TTL factor, that might or might not help.

che10
  • 2,176
  • 2
  • 4
  • 11
  • che10 Thank you. This time, Twilio controls the sending of notifications, so you can't do it here.It would be helpful if some kind of intervention could be done, but I think it is difficult. – takanao Jun 08 '21 at 09:45
  • @takanao You can reach out to their support team, but I am guessing they might already be doing this. I would say if possible handle the logic of sending notifications for calls at your end and depend on `Twilio` just for the calling utility. – che10 Jun 08 '21 at 09:46
  • che10 thank you. I am contacting the support team. I have been waiting for a long time.Is there an API for incoming call notification? If so it's great. Please tell me the page of the API manual. – takanao Jun 08 '21 at 10:54
  • @takanao There is no API as such. From what I remember is that we need some sort of room ID or something like that to join a Twilio call. I'm sorry I don't remember much, so we used to send all that data normal via Firebase and other use data. – che10 Jun 08 '21 at 10:58
  • The calling utility is the Android API, isn't it? In that case, I have to implement the incoming call handling myself. – takanao Jun 08 '21 at 11:00
  • Yes. We did that only @takanao. We just used normally FCM and it was already being used so. But, even that did not resolve the problem because it was still Firebase. I would suggest you wait up some more else think of something else like `WebRTC` or `Sockets` for implementing the utility to ping user for call. – che10 Jun 08 '21 at 11:06