question

Frank Ramirez avatar image
Frank Ramirez asked

Offline Chat via SharedGroupData

Hello, I am looking to integrate offline messaging with my PlayFab/Photon/Photon Chat game for up to 20 messages per conversation.

My thought is to created a SharedGroupData object whose name is the two players' PlayFab IDs sorted alphabetically. Each player would use the keys PLAYFABID-0 through 19, so they wouldn't try to write to the same key. The value would include a time stamp and the message. On the client I would then look at those keys and pick the 20 newest ones to display.

Does this sound like something that would be acceptable usage and would I have to limit the amount of SharedGroupData objects by deleting the conversation that was responded to last? Only players that have added each other as friends would be able to have private conversations.

Shared Group Data
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

So, Shared Group Data was designed for a fairly limited set of use cases where you have at most a few players who update the data, and then only occasionally. Think turn-based asynchronous games, where a player makes a move, then the other player makes a move later, etc.

So yes, you could use this for a limited form of message passing between players. However, it definitely isn't designed to support a "chat" feature, to be clear. For true chat between players, you would need to use Photon Chat (which you can get via our Add-ons Marketplace), or a similar service component.

2 comments
10 |1200

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

schweizerbenjamin97 avatar image schweizerbenjamin97 commented ·

The Problem with Photon Chat is that the messages are not reachable when a player is offline. So you have to be online. Or is there any option to store the latest 50 messages with Playfab?

0 Likes 0 ·
brendan avatar image brendan ♦♦ schweizerbenjamin97 commented ·

If the data is stored in our Content service, that's a CDN, so you could reasonably query it from many players. We'll also be providing an update to the data service to provide for "file storage", which will be a simplified way to use the Content service.

0 Likes 0 ·

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.