-
Notifications
You must be signed in to change notification settings - Fork 17
registerForNotifications #1
Comments
Hi mahal,
Thanks, |
So in Safari on the CloudKit catalogue on notifications page if you look at the network requests you see the URL:
Notice device and not database, which is different from the doc page on this.
The response is:
That webcourierURL is for long polling, and when a notification arrives it looks like this:
The ttl param is the number of seconds to wait, after that expires it sends: Note that I've been trying to call registerForNotifications from CloudKit.js using a Node console app and it errors with: Error: no auth method found. I think that method doesn't work with the server-to-server auth, and it requires the ckWebAuthToken (ckSession), do you know how to get one of those? |
Thanks for the detailed information. I'm working on implementing a notifications, expect to have it finished in a day or two. |
That would be excellent thanks. In return I can implement finishOnCallbackQueueWithError because I know how all that works. |
I've implemented notification support in acf651f however this implementation is not totally complete. As you mentioned above the long polling urls expire after the ttl. So currently it will still require some class to handle the reregistration of tokens once they expire or are used. I need to do a little more research on this. But in the meantime use the steps below in order to receive notifications in your project. Steps to receive notifications:
Also I'm not sure whether notifications are supported for Server-to-Server, so you may have to use a CloudKit account web auth token and set it via |
Do you have plans to implement the registerForNotifications feature?
The text was updated successfully, but these errors were encountered: