question

agniesportsyt avatar image
agniesportsyt asked

Can We call Cloud Scripts in Unity - void Update() for receiving a friend request ?

I found from Brendan that there is no friend request option available in PlayFab and we can never expect in the future as PlayFab don't work on - Friends, in game chat etc. But now I wanted to know can we use execute cloud scripts in the update function of PlayFab or no. As per my knowledge we cannot as there are limits to the cloud scripts calls. If so how/which part of the code can I notify the receiver of the friend request using cloud scripts and SharedGroupData which was showcased in the slideshare - advanced cloud scripts.

CloudScriptShared Group DataFriends
10 |1200

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

brendan avatar image
brendan answered

To be clear, I would never say you should "never expect" a feature change (though I may well say "for the foreseeable future"). We are continually taking feedback from developers and reviewing the requests we get through this forum and more direct discussions. So if there's a feature you want, it's a good idea to make sure you've let us know.

The built-in friends system in PlayFab works more similarly to a "follower" system, since it doesn't natively do two-way linking and there's no confirmation stage (accept or decline a friend request). If what you want is to build a system like that, you would want to either use polling from the client to check if there are outstanding friend requests, or else use a PubSub type model (an example is here: https://github.com/PlayFab/PlayFab-Samples/tree/master/Samples/CSharp/MessagingClient) to notify the client when there are updates it needs to check.

In addition to there being call rate limits on calls to Cloud Script, please bear in mind that each call to Cloud Script is going to "tick" the relevant meters for your title, which could wind up adding significantly to your costs.

As a side note, we would strongly recommend moving to our Azure Functions Cloud Script integration, as there are many advantages to the newer script service (debugging, more language support, being able to eliminate cold start issues with Azure Premium, etc.).

10 |1200

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

agniesportsyt avatar image
agniesportsyt answered

Ok thank you for your reply.

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.