question

Jan Vacek avatar image
Jan Vacek asked

How to access AdPlacements from azure functions

Hello, how can I access AdPlacements from azure functions? Im am using node.js api provided by you. There is only a PlayFabClientApi access, which is not recommended to use and wants from me additional login (at least I think it needs it, because it says UnhandledPromiseRejectionWarning: Must be logged in to call this method, but other serverApi calls is fine)

CloudScript
10 |1200

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

Sarah Zhang avatar image
Sarah Zhang answered

Do you want to access the Client API GetAdPlacements on CloudScript using Azure Functions? If so, for clarification, there is no need to call the Client API – GetAdPlacements on the server-side, such as Azure Functions, so we don’t provide the Server API for it. Could please clarify why you need to get the list of Ad placements on Azure Functions?

10 |1200

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

Jan Vacek avatar image
Jan Vacek answered

Ok, so, here is my situation.

I develop Unity mobile game, which is working with some data. The game doesnt care about things you are sending in for example CatalogItem. The game just need an "Item". This "Item" I am creating in azure functions from any kind of data you provide to me -> adPlacementReward, StoreItem, CatalogItem, ItemInstance - always there is an "Item" comming out from API to the game. Now I have to create a Factory for just 1 use-case that is creating an "Item", and it is because of adPlacements server api is missing

1 comment
10 |1200

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

Sarah Zhang avatar image Sarah Zhang commented ·

Thanks for your clarification, it seems your function will be run on the server-side totally and won't receive the parameters that sent from players? Unfortunately, our current built-in Rewarded Ad APIs are designed for the client-side only.

As this thread - https://community.playfab.com/questions/26981/giving-rewards-after-watching-an-ad.html said. If you need the server-to-server trigger logic, you'd need to implement it on your own.

If you require the official supports for the server APIs of Rewarded Ad, you can try to add a feature request for it.

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.