I’m tinkering around with RevenueCat for an app my company is releasing Q4 this year. We use Firebase as a simple backend.
Context:
One of our features is the submission of images for server-side processing. The submission of a job is done via a Firebase cloud function, and the abilities of the user to submit these jobs can be different depending on the user’s current subscription/entitlements. As such, it is important that the custom claims on the Firebase auth token are up-to-date when the backend function is called. Otherwise, the user might make a purchase to attain some feature, and not be able to access it immediately because the Function will reject their request.
Question:
When are the custom claims set, and can I expect them to be available immediately in my Firebase functions after a purchase?
More specifically, if I await any calls into RevenueCat when a purchase is made, will all Firebase functions called from that point onwards have the custom claim set in the request? Or is there some delay/asynchrony expected?
We’ll use the React Native purchases API if that is relevant.