question

doronhn avatar image
doronhn asked

how do i get the recharge countdown of my currency?

how do i get the recharge countdown of my currency?

apissdks
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JayZuo avatar image
JayZuo answered

You can use GetUserInventory function to get the countdown. In its response, you can find a VirtualCurrencyRechargeTimes and I'd think its SecondsToRecharge property is what you want.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

doronhn avatar image doronhn commented ·

Yes..

What is the best practice yo get the update time?

Call this every second? Call this in "update" function?

I am using unity.

0 Likes 0 ·
brendan avatar image brendan doronhn commented ·

Calling any API endpoint every second would get your title throttled and possibly blocked entirely, as that would be considered abusive behavior. You should only need to request the countdown time once - the clock on the local device is going to be able to track time just as accurately, so you can just use that timestamp to inform your local code.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.