Implementing Party/invite for friends to join together in a room

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Implementing Party/invite for friends to join together in a room

Sanjay_Varma
2021-02-19 06:23:52

Hello everyone.I started implementing Friends system using pun.I can see which of my friends are online.I have their userid.Now I need to send request to those playerId .My question is how I can send a message or we can say execute a function in another player so that they can join.Can anyone tell me how to implement it??.

I will try to explain my plan here.

Now I have the userid of my friends.Now I will send request to my friends.
If they accept my request there will be function which will start executing.
That function is FindFriends.It will take my userid and check whether I am in any room or not.
Once I am in a room my friends should also join my room by taking my roomparam from FindFriends.
Thank you

Comments

JohnTube
2021-02-19 17:11:46

Hi @Sanjay_Varma,

Thank you for choosing Photon!

You need to use Photon Chat or another service that allows exchanging direct messages between users.
This how you would send friend requests or game challenge/invitation.
PUN and Photon Realtime allows exchanged of messages only when joined to the same room.

Back to top