This is a real issue. I am trying to work out a solution. Any help would be appreciated.
The problem is...
1) suppose an app has 10,000 users
2) all users subscribe to receive an alert notification when there is a change in a single important record
3) if that record changes only once every month
4) when that record changes many of the 10,000 will open their app at the exact same time after receiving the alert notification, or at most within few seconds of each other
5) If the app then tries to download that changed record the 40/second limit will be hit and it will take over 5 minutes to download the change to the 10,000.
6) This assumes the app does a masterful job of queueing the 10,000 based upon the error CKErrorRequestRateLimited
How do you deal with this issue?
One solution is to include the entire record information in the notification and not query CloudKit after the notification. You could do that using alertLocalizationArgs or desiredKeys. But the value of each key "may be truncated (to 100 characters) when added to the push notification" and desiredKeys is limited to 3 keys. Does anyone know the limit to the number of keys you can have in alertLocalizationArgs and the allowable size of a total notification? Help!