question

Joe Hopkins avatar image
Joe Hopkins asked

How to send message from one user to another using PlayFab

How do we send a message from one user to another using PlayFab?

In Basketball PVP we would like a user to click on a PlayFab friend in the leaderboard, then our app would send a message to their friend's PlayFab account with the Photon region and the room name info. Then if their friend has the app open they would get the info and join the server/room.

FriendsMatchmaking
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

Since you're using Photon, the way to do this would be by using their FindFriends method. And you can send other messages between players using SendPrivateMessage.

We are planning on adding a generic messaging system, and when we do, we'll provide a system for notification. Right now, your options would be Push Notifications, or a persistent connection to the client using Photon Cloud or custom game servers (Client/GetFriendsList contains the current Lobby IDs for friends).

7 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.

Joe Hopkins avatar image Joe Hopkins commented ·

Thank you for the suggestion!

Unfortunately using Photon to do this will not work because the friend could be on a different Photon region. I opened a thread with Photon here that confirms this issue: http://forum.photonengine.com/discussion/9269/how-to-challenge-another-user-to-a-realtime-match

So it appears we will have to wait until PlayFab implements generic messaging. Is there a timeline for this?

We could implement a more complex Facebook/Push Notification hybrid system, but that still won't work for users with push notifications off who are not on Facebook.)

1 Like 1 ·
brendan avatar image brendan Joe Hopkins commented ·

We don't have a date for that yet, but it is something we want to add as soon as we can, as we see it as part of a complete tournament implementation. We should be able to provide more info on the timing for this later this quarter.

0 Likes 0 ·
Joe Hopkins avatar image Joe Hopkins brendan commented ·

Great thanks!

0 Likes 0 ·
Dylan Hunt avatar image Dylan Hunt commented ·

Any word on the messaging system?

Also, isn't SendPrivateMessage an extra +$45/mo, or is that included with PUN?

0 Likes 0 ·
brendan avatar image brendan Dylan Hunt commented ·

SendPrivateMessage is actually part of the Photon Cloud service, so you'd need to ask Exit Games about any specifics of that call - I was simply suggesting it as an alternative, above.

In terms of our generic messaging service, it's still on our backlog, but we don't have a specific date for it just yet.

0 Likes 0 ·
Hamza Lazaar avatar image Hamza Lazaar Dylan Hunt commented ·

SendPrivateMessage is part of Photon Chat. Different from PUN yes.

It requires a separate AppId and a separate plan.

0 Likes 0 ·
Dylan Hunt avatar image Dylan Hunt Dylan Hunt commented ·

Hm, Photon only offers messaging for +$45/mo O__o not the answer 99% people would likely be seeking (free at first, but if they're like me, we're planning for the future). I could probably get every premium feature within PlayFab for that price:

A proper messaging system like this would also allow for friend requests/accepts, room invites, and more with ease, without confusing shared data scripting (that will likey have to be re-coded later, if this is, indeed, still planned):

It wouldn't have to be real-time (it's understood that's not what PF is for); just a 1-2min poll, much like a friends list refresh.

Steam, for example, is extremely limited when it comes to stuff like this. It's better NOT to use Steam: You also don't want to be locked to Steam, if you're considering 3rd-party platforms as well. Did you know you can't handle notification via Steam when a friend requests you to a party? Only when you accept can I actually do something with it. This is just one example of limitations.

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.