Question

How to force Subscriber attributes sync with Revenuecat servers

  • 28 July 2021
  • 6 replies
  • 334 views

Badge +1

According to Revenuecat documentation:

“Subscriber attributes are only synced with RevenueCat servers on app launch, app backgrounded, and when purchases are made or restored.”

 

However, we want to sync these attributes to RevenueCat servers without app being sent to background.

As you can see from the attached pictures of code I tried, and debug logs, I could never force subscriber attributes to be synced to revenuecat servers without app being sent to background. 

They are also synced if there is a purchase, but after purchase event. However, we need to use them for before purchase event. Because they are missing with the initial purchase event webhook we are receiving from revenuecat.

Any help would be greatly appreciated, thanks

 


6 replies

Userlevel 5
Badge +9

There is not a way to force a sync of Subscriber Attributes with RevenueCat servers from the Purchases SDK, but they are synced when a purchase is made so they will be available with an INITIAL_PURCHASE webhook.

 

If you need a more realtime datastore it’s probably worth looking into hosting your own database. 

Badge +1

Hi Ryan, thank you for your fast response.

My only problem is that they are missing with initial_purchase webhook. I do not expect anymore realtime than seeing them with the initial_purchase webhook.

They are only missing with initial_purchase but exist with all other future events. Any tips/ideas why this could happen?

We are using Purchases.purchasePackage() function to make purchase.

Badge +1

@ryan 
Here are example event screenshots from user below

Please observe that initial_purchase is missing skoove_id attribute, which actually is set at an earlier time than initial_purchase event when timestamps are also examined on the renewal event.

https://app.revenuecat.com/customers/871cbba6/3bd3b2f2-3e4e-567a-bf5d-5


I’d highly appreciate your comment on this. thanks

 

Userlevel 5
Badge +9

Thanks for the extra info, I’m taking a closer look. Would it be possible to attach a .txt file of everything that the debug logs output from initialization through purchase? It will help me see some timestamps of when the set attributes call is being called by the SDK, when the purchase is occurring, and when the subscriber attribute actually gets synced. Also, SDK version should be in the debug logs but that would be good to know too.

Badge
  • Hello Ryan, I worked together with Halid, follow the internal logs, as you can check we are facing 2 strange issues:
    - The restore Purchases are not sync the Restore Purchase
    - And the ERROR: 😿‼️ There was an unknown backend error, when the SDK tries to POST without any user id.

    When we do a Purchase the attributed is synced, and sometimes the INITIAL_PURCHASE event is faster than then the saved attribute.

    Thank you
Userlevel 1
Badge +8

I am seeing the same issue on the “NON_RENEWING_PURCHASE” webhook. We use the custom attributes on the webhook event to do some stuff in our BE. This the above mean that we can not rely on the webhook not having the must up-to date attributes?

Reply