Solved

How to integrate WebHooks with Firebase RealTimeDatabase

  • 16 July 2023
  • 3 replies
  • 148 views

Badge +3

I have Apple/Google Notifications linked to RevCat. Every time a user’s subscription is renewed, paused, cancelled, etc, I would like to send/sync that info to the same userId in the RealTimeDatabase,  eg. db schema

// anyone under the users ref isn't anonymous

users

    -userID_123 // whenever this user’s subscription is renewed/cancelled I need this node to receive the update with the accompanying subscription data

 

I looked at Firebase Integration Docs and it only mentions Cloud FireStore. I went to the Firebase console > Extensions > RevenueCat and it only says that it supports FireStore. I don't use FireStore for my backend, I only use RTDB.

 

1- How can I sync these subscription updates to the RealTimeDatabase?

2- Do you have any links on how to do it with specific subscription data, for example, I only need the renewal and cancellation dates, I don't need all of the other info. I’ve googled around and can't find anything.

 

 

icon

Best answer by lance-samaria 16 July 2023, 08:30

View original

3 replies

Badge +3

I added an answer but it’s incorrect. I don't see an option to delete this.

Userlevel 4
Badge +8

Hi, you’d need to implement yourself how to send data to the RealTimeDatabase as our extension does not support it at this time. 

1- How can I sync these subscription updates to the RealTimeDatabase?

I would recommend listening to our webhooks as this will notify your backend of subscription updates, and then you can send that data to the RealTimeDatabase: https://www.revenuecat.com/docs/webhooks

 

2- Do you have any links on how to do it with specific subscription data, for example, I only need the renewal and cancellation dates, I don't need all of the other info. I’ve googled around and can't find anything.

With our webhooks, you can listen to the event types of RENEWAL and CANCELLATION to get these values: https://www.revenuecat.com/docs/event-types-and-fields

 

Badge +3

@Haley Pace Thanks for the info Haley! I’d switch your answer to the correct answer but I can't delete my previous answer (or switch it).

 

For anyone reading this, Haley’s answer is the correct answer to this question.

Reply