Koala provides the static meet_challenge method to take care of most of the details with verifying your callback .

lvsownerdata updating realtime-71lvsownerdata updating realtime-68lvsownerdata updating realtime-64

Retrieved documents have a property that indicates whether the document has local changes that haven't been written to the backend yet.

You can use this property to repeat the previous example but show the difference between the two events: It is often useful to see the actual changes to query results between query snapshots, instead of simply using the entire query snapshot.

As shown above, your listener will then be notified again once the data is actually written to the backend.

This could take any amount of time from a few milliseconds to a few hours, depending on the state of your network connection.

If not, Facebook will not be able to verify the callback .

In response, your application must check that the given verify token matches the verify token used when adding/updating a subscription and, if so, return the given challenge.

If you know what the value of the verify_token should be, you can just pass it in directly: If you sent a specially constructed value for verify_token when adding/updating your subscription (such as a hash of various values), you can pass meet_challenge a block (which takes a token as its only parameter) and meet_challenge will only verify the token if the block returns true.

If the token is valid, meet_challenge will return the challenge value in the given params, and if not returns false.

For example, you may want to maintain a cache as individual documents are added, removed, and modified.