I need a player's master id for my function.
so I use to like this "req.body.CallerEntityProfile.Lineage.MasterPlayerAccountId"
but always return "undefined" only via scheduled tasks.
what should I do about this?
I need a player's master id for my function.
so I use to like this "req.body.CallerEntityProfile.Lineage.MasterPlayerAccountId"
but always return "undefined" only via scheduled tasks.
what should I do about this?
Because Scheduled Task's request to call Azure Function is different compared to Azure Function called by the client. But the MasterPlayerAccountId is contained in the req, you can obtain it with the code below.
string requestBody = await new StreamReader(req.Body).ReadToEndAsync();
JObject jsonO = JObject.Parse(requestBody);
string PlayFabId = jsonO["PlayerProfile"]["PlayerId"].ToString();
[Update]
We recommend Using CloudScript context models to access the request from Scheduled Task.
Thank u for ur help.
I just checked it. and it is working well for me.
2 People are following this question.