All Collections
Portal-X Pages
Design | Messaging | Messaging
Design | Messaging | Messaging

Settings for one-to-one messaging service

Jason Liang avatar
Written by Jason Liang
Updated over a week ago

brainCloud messaging refers to a form of communication that involves a one-to-one conversation. This entails the explicit designation of the profile ID of the intended recipients when sending messages. It is important to note that this differs from chat, where messages are accessible to all individuals connected to a chat channel.

Messages persist over time. They can be retrieved later if the receiver may not be online at the time they are sending. The paradigm is similar to email, but messages stay within your app.

Configs messaging service:

Go get started, and find the Configure Messaging page on the brainCloud portal.

  • Enable messaging service for your app by checking the first checkbox. Fill in all the required fields respectively. Click the Save button to complete your configuration.

    • Max Message Size (128 - 2048 bytes): Maximum size allowed for each message.

    • Max Stored Messages (5 - 50 messages): Maximum number of messages allowed for each user.

    • Max Retention in Days (1 - 90 days): Maximum number of days to save a message.

Test:

  • Download the Unity test example from here. Unzip it and open it with Unity Hub.

  • Test from the editor as below or build it into any platform that fits your test device.

  • Logging your app from the brainCloud setting tab:

  • Run the game, fill in the [User Name] and [Password] input fields with any words you prefer, and click Auth button, you will see the success return like below, note down the profileId you got from the response.

  • Go to the brainCloud portal login to the same app as above, find page Design | Cloud Code | API Explorer, and authenticate with a different user from above.

  • Select Messaging Service and SendMessageSimple Operation, and put the profileId you got from the Unity app as the receiver id.

  • Switch back to your Unity app, and click the getMessages button, to check if the user received the message that was sent from the brainCloud portal.

  • Now, let's test online messaging with RTT enabled. Before testing, make sure your app has been configured as RTT enabled.

  • Click enableRTT button from your Unity app, you should see the return below with RTT connect success info.

  • Switch back to the brainCloud portal, and send a new message to this profiled again:

  • You should find your Unity app return message is auto-refreshed with this new message:

Did this answer your question?