Reputation: 890
I've asked already about collapse key limit and get correct answer here from @ianhanniballake. Now, i want to precise something. The limit on GCM collapse_keys is on a per app level. What does it mean app level? For example, there is two apps installed on two corresponds devices, i.e.
Whether the each app's instance can have 4 collapse keys a maximum or 4 collapse keys is on all app instances? What is link between gcm registration id and 4 collapse keys, 4 collapse keys per one registration id or 4 collapse keys per all registrtion ids (per all users of app)? In our app we have user session entity, which can live two mounth, can we use session id as collapse key or collapse key must to be only constant string? Somebody help me please!
Upvotes: 1
Views: 2430
Reputation: 393791
The 4 collapse key maximum is 4 per device, which means 4 per app instance (and since each app instance has a different Registration ID, this also means 4 per one Registration ID).
GCM allows a maximum of 4 different collapse keys to be used by the GCM server per device any given time. In other words, the GCM server can simultaneously store 4 different send-to-sync messages, each with a different collapse key.
(Source)
As for using session id as collapse key, there is nothing stopping you from doing that, but there is really no need. Since messages are collapsed only for the same collapse key and same Registration ID, you can use the same collapse key in all your app instances. I'm assuming this would make your server code simpler.
Upvotes: 1