Skip to main content
Solved

How to integrate WebHooks with Firebase RealTimeDatabase


Forum|alt.badge.img+4

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.

 

 

Best answer by lance-samaria

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

View original
Did this post help you find an answer to your question?
This post has been closed for comments

3 replies

Forum|alt.badge.img+4
  • Author
  • Active Helper
  • 15 replies
  • Answer
  • July 16, 2023

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


Forum|alt.badge.img+8
  • RevenueCat Staff
  • 562 replies
  • July 24, 2023

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

 


Forum|alt.badge.img+4
  • Author
  • Active Helper
  • 15 replies
  • July 24, 2023

@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.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings