GCM: se o dispositivo do cliente não tiver conexão com a internet por tempo limitado?

0

A minha pergunta é se o dispositivo do cliente não tem ligação à internet, por um período de tempo limitado, então o pedido de notificação por push do GCM foi adicionado na fila ou qualquer outra coisa? Em caso afirmativo, quanto tempo até que as solicitações sejam descartadas?

    
por bob jeffer 18.09.2015 / 07:04

1 resposta

1

Então, no guia oficial , veja como funciona o GCM:

Setting the lifespan of a message

GCM 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 the sender itself might request that messages not be delivered until the device becomes active by using the delay_while_idle flag. Finally, GCM might intentionally delay messages to prevent an application from consuming excessive resources and negatively impacting battery life.

When this happens, GCM will store the message and deliver it as soon as it's feasible. While this is fine in most cases, there are some applications 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 will only be meaningful for a small period of time before the call is terminated. Or if the message is an invitation to an event, it will be useless if received after the event has ended.

You can use the time_to_live parameter in the send request to specify the maximum lifespan of a message. The value of this parameter must be a duration from 0 to 2,419,200 seconds, and it corresponds to the maximum period of time for which GCM will store and try to deliver the message. Requests that don't contain this field default to the maximum period of 4 weeks.

    
por 22.09.2015 / 23:45

Tags