Photon Chat Intro

Get Started

Keep your users communicating while they are online using Photon Chat. Photon Chat applications need a distinct application and AppId to connect to.

Get your AppId from the Chat Dashboard after
free signup

Back To Top
 

Connect

To get updates and messages, your application has to implement several methods that are used as callback.

Aside AppId, Connect() is passed the version, an arbitrary string, and the username, a unique name in best case.

Back To Top
 

Call Service

To keep the connection alive and to get incoming messages continuously call:

Back To Top
 

Subscribe To Public Channels

Only public channels needs subscriptions. Private channels do not require this.

With Photon Chat you use public channels to group users or topics. Anyone who subscribes to a public channel gets all messages published within. New channels are created upon first subscription.

Pass an array of strings to Subscribe, for the channels to be subscribed.

Subscribing and unsubscribing will update ChatClient.PublicChannels. Optionally, the ChatChannel instances get the list of subscribers, which updates ChatChannel.Subscribers.

Back To Top
 

Send

Public Messages

Prior to publishing, subscribe to the channel you want to publish messages in. Publish messages to all subscribers of a channel with:

Other than plain strings Photon Chat allows you to define complex messages, e.g. for invitations.

Back To Top
 

Private Messages

Unlike public channels, private channels do not require prior subscription.

Send a private message to any user with:

Back To Top
 

Receive

Public Messages

To handle incoming public messages from all subscribed public channels you need a proper chat listener callback:

Back To Top
 

Private Messages

Unlike public channels, private channels do not require prior subscription.

To receive and parse private messages you implement the following chat listener callback:

Back To Top
 

Online Status

Own Status

Set the online status for your players and an optional status message with:

Define your own statuses using integers.

Back To Top
 

Friends Status

Just send an array of usernames to Photon to get their future status updates.

You'll receive updates with the current status per friend to the implemented callback:


To Document Top