GCM Usages - Notifications and updates

30 views
Skip to first unread message

Moran A

unread,
Jan 31, 2017, 7:27:06 AM1/31/17
to android-gcm
Dear All,

I use GCM (will upgrade to FCM soon) to send notifications to my clients, Android based devices.
In addition, due to the fact that each change effects other users view, i update those controllers using GCM as well.

Is it the best practices, to use GCM for notifications and updated for other clients?
Is there a better way?
Should i use GCM just for notification and not for updates?

Thanks in advance.

Diego Giorgini

unread,
Jan 31, 2017, 2:20:30 PM1/31/17
to android-gcm
Hi Moran

GCM (and FCM) provides notification-messages (for easy to implement notifications) and data-messages (for more custom notifications or any custom logic).
The main best practice I can recommend is to keep the logic triggered by data-messages very quick (less than 10 seconds). In case you need to execute for more than 10 seconds I recommend to use GCM/FCM to register a JobScheduler task, and perform the long computation inside the JobScheduler task.

Best,
- Diego

--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-gcm...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-gcm/ae8f3adb-73a2-4ab3-bc9f-c03bb42b7186%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Moran A

unread,
Jan 31, 2017, 3:09:24 PM1/31/17
to android-gcm
Hi Diego,
Thanks for your reply.

The frequency for my updates changes from time to time, it can be every couple of seconds, minutes and hours.

What's best for general updates with different frequency?
How to use the JobScheduler? what cases?
 
Thanks.

Diego Giorgini

unread,
Jan 31, 2017, 5:10:42 PM1/31/17
to andro...@googlegroups.com
I was not referring to the frequency of the updates, but on the length of the computation after you receive the message.

If the message triggers a notification, change on the UI, or a quick write to disk, then you don't need to schedule a JobTask because these operations will take less than 10 seconds.

If the message triggers the download of a big file, a long sync operation, or any other time-consuming operation, then you should use GCM to schedule a task with the JobScheduler. And perform the long operation in the JobScheduler task.



Moran A

unread,
Feb 1, 2017, 1:18:54 AM2/1/17
to android-gcm
No, it's very quick and does last long. .
Does it mean that i can use GCM for all cases (notifications and updates) and not other pub-sub mechanism for updates?
i'm asking because i guess Google doesn't give us commitment that the notification certainly arrives.

Thanks.

Massimiliano

unread,
May 1, 2024, 8:19:31 PM (10 days ago) May 1
to android-gcm
MT103/202 DIRECT WIRE TRANSFER
PAYPAL TRANSFER
CASHAPP TRANSFER
ZELLE TRANSFER
LOAN DEAL
TRANSFER WISE
WESTERN UNION TRANSFER
BITCOIN FLASHING
BANK ACCOUNT LOADING/FLASHING
IBAN TO IBAN TRANSFER
MONEYGRAM TRANSFER
IPIP/DTC
SLBC PROVIDER
CREDIT CARD TOP UP
DUMPS/ PINS
SEPA TRANSFER
WIRE TRANSFER
BITCOIN TOP UP
GLOBALPAY INC US
SKRILL USA
UNIONPAY RECEIVER

Thanks.


NOTE; ONLY SERIOUS / RELIABLE RECEIVERS CAN CONTACT.

DM ME ON WHATSAPP
+44 7529 555638

Reply all
Reply to author
Forward
0 new messages