question

cleversons@gmail.com avatar image
cleversons@gmail.com asked

,RewardAdActivity parameters

Hi!

The RewardAdActivity API requires 2 parameters: PlacementId and RewardId. Where can I get the values for these parameters on Game Manager? I want to avoid having to call GetAdPlacements if PlacementId and RewardId don't change during game sessions.

apisIn-Game Economy
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

·
Sarah Zhang avatar image
Sarah Zhang answered

Firstly, there are not these two parameters – PlacementId, RewarId in the Game Manager. Currently, the only way to retrieve them is to call the Client API - GetAdPlacements. To display them in the Game Manager, as a workaround, you can consider storing them somewhere of the Game Manager manually. For instance, you can register a player account to call the API GetAdPlacements to retrieve the PlacementId and RewarId. Then call the Admin API SetTitleInternalData or navigate to [Game Manager]->[content]->[Title Data] tab to create a new title internal data K/V pair and store them as its value. Then, you can click the corresponding title internal data key on the [Title Data] tab or call the Server API GetTitleInternalData to check them.

Besides, please note, the reward Ids returned by this Client API – GetAdPlacements is from the rewards assigned randomly according to the weightings. It means, if you set up multiple rewards for a placement, two calls of this API may return the reward Ids from different rewards. You can check this documentation - Quickstart: Set up an Ad placement, specifically this section - Rewarding Ad Activity for more information about how the API GetAdPlacements works.

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.

cleversons@gmail.com avatar image cleversons@gmail.com commented ·

Thanks Sarah!

Considering I have only 1 reward per placement, is it safe to cache the RewardId and use it across sessions?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang cleversons@gmail.com commented ·

Since the Reward ID can be retrieved using Client API GetAdPlacements and the number of rewards is set up separately. Caching it within a session should be safe. We would suggest you try to cache it within a session instead of across session to prevent it being obtained by unauthorized clients.

0 Likes 0 ·

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.