question

freelancegordon avatar image
freelancegordon asked

Cloudscript and receiving a callback from Mopub's Rewarded Video Ads

Hi guys,

I'm looking into setting up a server-side callback from Mopub for when a user watched a rewarded video ad, but I'm having trouble working out how to construct the URL.

Mopub only gives you a box to enter a URL in, inside of that I have to designate everything described in the post request in the documentation

POST https://{
                 {TitleID}}.playfabapi.com/Server/ExecuteCloudScript
          Content-Type: application/json
          X-SecretKey: <title_key_value>{
  "PlayFabId": "1337D00D",
  "FunctionName": "levelCompleted",
  "FunctionParameter": {
    "level": 3,
    "points": 400
  },
  "RevisionSelection": "Live",
  "GeneratePlayStreamEvent": true
}

This makes sense, mopub provides a way of injecting variables so I can pass through the player id, the name of the currency and the amount of currency I want to award, but I'm a bit stuck on how I need to actually format the URL itself from the above post request so that I can call the cloudscript function and pass the data through.

Thanks in advance for any help!

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.

1 Answer

·
brendan avatar image
brendan answered

Well, to do it that way, you'd need to have the Secret Key entered into their setup as a Header on the POST message. From a quick review of their documentation, it would appear that they don't provide a way to do that (and I would advise against it at any rate, since exposing your Secret Key outside your team is extremely risky at best), but rather use their verifier hash system for security.

We recently introduced a beta for rewarded ads that you may want to try, as well. We're adding people to it as we get feedback from the first wave of folks testing it. The way rewarded ads work, you're able to define a reward in PlayFab which is similar in many ways to our random result tables, and use it to grant players VC/items when they have completed viewing ads. We'll be integrating ad partners for full ad mediation and securing the rewards post-GDC, but if you'd like to try the beta, please open a ticket with us on this page (or email us at devrel@playfab.com).

10 |1200

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

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.