question

Reid Taylor avatar image
Reid Taylor asked

Ok to PlayFabClientAPI.GetFriendsList every second?

Hello, I'm working on a squad system and I need to know when a friend has invited me... Is it ok on mobile performance wise and PlayFab wise to call

PlayFabClientAPI.GetFriendsList

every second? How often would you recommend to call it if I need fairly instant alert when friend invites me?

Friends
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

I would recommend only doing this every few minutes. Please bear in mind that all use of PlayFab is usage-based, and returned data from calls like GetFriendsList hit the Profile Read meter at a rate of 1 per 1 KB in the response data. So every time you make this call, you'll be adding N to the Profile Read meter, depending on how many friends the player has and how much additional information you are pulling from the profile in that query.

What you really want is a PubSub (publish/subscribe) system, so that clients can "listen" for events when they occur. We do plan to offer a PubSub service in the future (we do not have a specific date for this yet), but we have a sample showing how you could implement a system like this today here: PlayFab-Samples/Samples/CSharp/MessagingClient at master PlayFab/PlayFab-Samples (github.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.