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!
Answer by Brendan · Feb 23, 2017 at 07:50 PM
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).
MySQL access from cloudscript 2 Answers
Any way to get the actual definition of Bundle contents? 1 Answer
CloudScript fails when accessing URL property in object 1 Answer
CloudScript Windows10 5 Answers