Features
Games
Add-ons
Docs
Pricing
Forums
Blog
Log in
Sign Up

Features

Games

Add-ons

Docs

Pricing

Support

Blog

Log in

Sign Up

  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by larissa · Feb 08, 2018 at 02:46 PM · apisPlayStreamtasks

Location - Latitude and Langitude missing in context

Hey there! :)

----

When running a task on a player segment, which executes a Cloudscript functions, the playerProfile in the context parameter looks like this:

{
    "playerProfile": {
        "PlayerId": "3AD2...",
        "DisplayName": "lissi",


	...

        "Locations": {
            "LastLogin": {
                "ContinentCode": "EU",
                "CountryCode": "DE",
                "City": "Frankfurt am Main",
                "Latitude": null,
                "Longitude": null
            }
        },

	...

}

I have several questions regarding this.

1.) Why are Latitude and Longitude missing here - even though when the Last Login happened, they were included in the event, and they also show up, when manually requesting the Profile via GetPlayerProfile?

2.) What keys can be expected to be available within the "Locations"-dictionary? Only "LastLogin", or any others as well? Is "LastLogin" guaranteed to be there? The documentation ( https://api.playfab.com/playstream/profile/PlayerProfile ) does not seem to mention this.

3.) Somewhat unrelated: When manually requesting the Players Locations via GetPlayerProfile, which Locations can be expected to be in the list (is there for example a certain timeframe or a certain amount of locations that are stored on the server?). Is the list ordered? Is there a guarantee, that at least the most recent location will be included?

---

Thanks!

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by Brendan · Feb 08, 2018 at 07:18 PM

The profile only contains the last location (last login). If the lat/long are null, that would normally be due to them having been null in the associated event. In my own testing, they show up in the profile the same way they do in the event. If you can give me the Title ID you're testing, the PlayFab ID of your player, and the ID of the Task, I can have a look at your title to see why you're getting different results.

Comment

People who like this

0 Show 5 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image larissa · Feb 09, 2018 at 02:36 AM 0
Share

Thanks! I checked the previous login-events (player_logged_in) of this player (as well as other players) and they always had non-null lat/long values. Here's the details:

TitleID: 6131

TaskID: 6234B1911A6F188E

PlayFabID: 3AD264F1DD7F6299 (but it happened for *every* player I tested)

Cloudscript Revision: 1018

(The cloudscript function I execute is logging the context, that's how I got the above result. The result can be seen in the playstream as well)

avatar image Brendan ♦♦ larissa · Feb 09, 2018 at 02:51 AM 0
Share

I just tested querying that player's profile in your title, and it had the lat/long data:

{
    "code": 200,
    "status": "OK",
    "data": {
        "PlayerProfile": {
            "PublisherId": "9FC655C648B8DA29",
            "TitleId": "6131",
            "PlayerId": "3AD264F1DD7F6299",
            "Locations": [
                {
                    "ContinentCode": "EU",
                    "CountryCode": "DE",
                    "Latitude": 51.{removed - potential PII},
                    "Longitude": 9.{removed - potential PII}
                }
            ]
        }
    }
}

What is the specific handler in your Cloud Script you're using for this?

avatar image larissa Brendan ♦♦ · Feb 09, 2018 at 03:00 AM 0
Share

"EnqueueNotificationTask" - as of now it does nothing but check the args for a password and log the context:

handlers.EnqueueNotificationTask = function (args, context)
{
    let notificationTaskArgs = getJsonObjectFromArgs(args);

    if (!notificationTaskArgs.hasOwnProperty(kPasswordKey) || notificationTaskArgs[kPasswordKey] !== kPassword)
    {
        logd("Error: EnqueueNotificationTask missing password");
        return false;
    }

    logd("The Context:");
    logd(JSON.stringify(context));
}

Please note this happens specifically when running the scheduled task, it might not happen when running the handler manually. Maybe you can try it with the task as well

TaskID: 6234B1911A6F188E
Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Can you pass custom PlayStream events to Webhooks? 1 Answer

    PlayStream RestrictedFIeldName reserved PlayFab fields? 1 Answer

    How do I find the player who exceeded the limit? 1 Answer

    Friend system clarifications 1 Answer

    Can a Drop Table be configured to drop zero items? 1 Answer

    Tickets

    Need help with a confidential issue? We've got your back!

  • Create Ticket
  • View Open Tickets
  • Stay up-to-date with the latest from PlayFab:  
    Sign up for newsletter
    Engineers
    • Documentation
    • Tutorials
    • API Reference
    • SDKs
    • Usage Limits
    PLAYFAB
    • Features
    • Games
    • Add-ons
    • Pricing
    Support
    • Forums
    • Videos
    • File a Ticket
    • Service Health
    • Blog
    About
    • About
    • Jobs
    • Contact
    • Press Room
    • Privacy Policy
    • Terms of Service
    • Acceptable Use
    • Style Guide
     
     
    Sign Up

    ©2017 PlayFab, Inc.

    ©2016 PlayFab, Inc. All rights reserved. PlayFab® is a registered trademark of PlayFab, Inc. | Privacy | Terms | Acceptable Use
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Post an idea
    • Create an article
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Ideas
    • Articles
    • Users
    • Badges