Question

Revenuecat not setting claims to firebase (emulator)

  • 17 January 2023
  • 5 replies
  • 168 views

Badge +3

I just finished setting up revenuecat with firebase as per documentation. I got a firebase function that is supposed to check if a user is premium via claims. I also setup the emulators accordingly, i think. I imported the extension as well and if needed i can give the firebase.json.

No trace of claims show up in either of these results called in the function after the user successfully subscribed:

 

```ts

    const tokenResult = await admin.auth().verifyIdToken(idToken);
    if (idToken) {
      functions.logger.info("tokenResult: ", tokenResult);
      admin.auth().getUser(tokenResult.uid).then((user) => {
        functions.logger.info("user: ", user);
      });
```

All i get is the usual firebase auth data. It’s also not writing anything to the firestore emulator. Can anybody help me figure out what am i doing wrong?

 

 


5 replies

Badge +3

Can anybody please tell me if firebase functions emulator alongside revenuecat is supported? I’m stuck and i can’t move forward.

Badge +3

Still haven’t solved… I went through the whole setup docs for the 4th time.

Badge +3

Hi there! We’ve been working on this is a support ticket, but I wanted to post here as well for visibility to any other developers using the Firebase emulator suite.


Bear in mind when you’re running the emulator locally, that we will always send events to the HTTPS endpoint that is configured in our Firebase extension settings under “Webhook URL”. We can’t send events to a localhost endpoint. If you want our events to reach your local emulator, make sure that your device is reachable from the internet and change the “Webhook URL” to your Firebase emulator’s public address.

Badge +3

make sure that your device is reachable from the internet and change the “Webhook URL” to your Firebase emulator’s public address.

This doesn’t work since the textbox on the revenuecat’s dashboard doesn’t accept any link outside of the cloudfunctions domain.

I tried using an ngrok tunnel link in this case.

 

Badge +3

After 9 months, has this been fixed or do we still need to test purchases in production?
edit: yup, still nothing, i still can’t test purchases with the emulator

Reply