Messages
Overview
Players in a channel can exchange messages. At the same time, it is possible to implement sending a personal message, as well as messages to a feed or channel. Implemented methods that allow you to change and delete sent messages. Messages can also be used to send gifts to players or even turn-based battles.
This section covers methods for working with messages. The service allows you to send, change, delete messages and much more:
gp.channels.sendMessage
- sending the message to the channel +1 Requestgp.channels.sendPersonalMessage
- sending a personal message to the player +1 Requestgp.channels.sendFeedMessage
- sending a message to a feed +1 Requestgp.channels.editMessage
- change the sent message +1 Requestgp.channels.deleteMessage
- delete the sent message +1 Requestgp.channels.fetchMessages
- get a list of messages in the selected channel +1 Requestgp.channels.fetchMoreMessages
- additionally load messages in the channel +1 Requestgp.channels.fetchPersonalMessages
- get a list of private messages +1 Requestgp.channels.fetchMorePersonalMessages
- additional download private messages +1 Requestgp.channels.fetchFeedMessages
- get a list of posts in a player's feed +1 Requestgp.channels.fetchMoreFeedMessages
- additionally load messages in the feed +1 Request
Sending a Message
+1 RequestTo send a Hello!
message to the channel channelId: 123
, use the gp.channels.sendMessage
method:
- JavaScript
- Unity
gp.channels.sendMessage({
// Channel ID
channelId: 123,
// Message text
text: 'Hello!',
// Tags of messages for convenient filtration, optional
tags: ['chat', 'trade'],
});
GP_Channels.SendMessage(
// Channel ID
channel_ID: 123,
// Message text
text: "Hello!",
// Tags of messages for convenient filtration, optional
tags: "chat, trade"
);
Sending a Private Message and to the Player's Feed
+1 RequestThere is an option to send a private message to the player and send a message to the feed.
Feed - a player's public channel, to which any member of the channel can send a message
To send a private message Hello!
to the player playerId: 123456
, use the method gp.channels.sendPersonalMessage
:
- JavaScript
- Unity
gp.channels.sendPersonalMessage({
// ID player
playerId: 123,
// Message text
text: 'Hello!',
// Tags of messages for convenient filtration, optional
tags: ['chat', 'trade'],
});
GP_Channels.SendPersonalMessage(
// ID player
player_ID: 123,
// Message text
text: "Hello!",
// Tags of messages for convenient filtration, optional
tags: "chat, trade"
);
To send a message to the feed gp.channels.sendFeedMessage
:
- JavaScript
- Unity
gp.channels.sendFeedMessage({
// ID player
playerId: 123,
// Message text
text: 'Hello!',
// Tags of messages for convenient filtration, optional
tags: ['chat', 'trade'],
});
GP_Channels.SendFeedMessage(
// ID player
player_ID: 123,
// Message text
text: "Hello!",
// Tags of messages for convenient filtration, optional
tags: "chat, trade"
);
To get the result of the method call, you can subscribe to events:
- JavaScript
- Unity
gp.channels.on('sendMessage', (message) => {
// Successfully sent
// The ID of the post, it can be used to edit or delete the post
message.id
// Channel ID
message.channelId
// Post Author ID
message.authorId
// Message text
message.text
// Tags of messages
message.tags
// Public fields of the player - sender of messages
message.player
// Message sent time
message.createdAt
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnSendMessage += OnSendMessage;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnSendMessage -= OnSendMessage;
}
// Successfully sent
private void OnSendMessage(GP_Data data)
{
var sendMessageData = data.Get<Message_Data>();
Debug.Log("SEND MESSAGE: CHANNEL ID: " + sendMessageData.channelId);
Debug.Log("SEND MESSAGE: AUTHOR ID: " + sendMessageData.authorId);
Debug.Log("SEND MESSAGE: ID: " + sendMessageData.id);
Debug.Log("SEND MESSAGE: TEXT: " + sendMessageData.text);
for (int i = 0; i < sendMessageData.tags.Length; i++)
{
Debug.Log("SEND MESSAGE: TAGS: " + sendMessageData.tags[i]);
}
Debug.Log("SEND MESSAGE: CREATED AT: " + sendMessageData.createdAt);
Debug.Log("SEND MESSAGE: PLAYER: AVATAR: " + sendMessageData.player.avatar);
Debug.Log("SEND MESSAGE: PLAYER: CREDITIALS: " + sendMessageData.player.credentials);
Debug.Log("SEND MESSAGE: PLAYER: ID: " + sendMessageData.player.id);
Debug.Log("SEND MESSAGE: PLAYER: NAME: " + sendMessageData.player.name);
Debug.Log("SEND MESSAGE: PLAYER: PLATFORM TYPE: " + sendMessageData.player.platformType);
Debug.Log("SEND MESSAGE: PLAYER: PROJECT ID: " + sendMessageData.player.projectId);
Debug.Log("SEND MESSAGE: PLAYER: SCORE: " + sendMessageData.player.score);
}
Execution with an error:
- JavaScript
- Unity
gp.channels.on('error:sendMessage', (err) => {
// Completed with an error
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnSendMessageError += OnSendMessageError;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnSendMessageError -= OnSendMessageError;
}
// Completed with an error
private void OnSendMessageError() => Debug.Log("SEND MESSAGE: ERROR");
Possible errors are shown in the table below:
Basic Errors | Script Errors | Scripted only for sendMessage |
---|---|---|
player_not_found | empty_message | empty_channel_id |
project_not_found | access_denied | channel_not_found |
origin_not_allowed | message_characters_limit_exceeds | |
player_banned | ||
internal_error |
When a message is sent to all players in the channel, a notification of a new message is received:
- JavaScript
- Unity
gp.channels.on('event:message', (message) => {
// Channel ID
message.channelId;
// ID messages
message.id;
// ID of the author of the message
message.authorId;
// Author's fields (avatar, name, custom fields)
message.player;
// Message text
message.text;
// Tags of messages
message.tags;
// The date of sending the message
message.createdAt;
// Message target: 'CHANNEL' | 'PERSONAL' | 'FEED'
message.target;
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnMessage += OnMessage;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnMessage -= OnMessage;
}
private void OnMessage(GP_Data data)
{
var messageData = data.Get<Message_Data>();
Debug.Log("ON MESSAGE EVENT: CHANNEL ID: " + messageData.channelId);
Debug.Log("ON MESSAGE EVENT: AUTHOR ID: " + messageData.authorId);
Debug.Log("ON MESSAGE EVENT: ID: " + messageData.id);
Debug.Log("ON MESSAGE EVENT: TEXT: " + messageData.text);
for (int i = 0; i < messageData.tags.Length; i++)
{
Debug.Log("ON MESSAGE EVENT: TAGS: " + messageData.tags[i]);
}
Debug.Log("ON MESSAGE EVENT: CREATED AT: " + messageData.createdAt);
Debug.Log("ON MESSAGE EVENT: PLAYER: AVATAR: " + messageData.player.avatar);
Debug.Log("ON MESSAGE EVENT: PLAYER: CREDITIALS: " + messageData.player.credentials);
Debug.Log("ON MESSAGE EVENT: PLAYER: ID: " + messageData.player.id);
Debug.Log("ON MESSAGE EVENT: PLAYER: NAME: " + messageData.player.name);
Debug.Log("ON MESSAGE EVENT: PLAYER: PLATFORM TYPE: " + messageData.player.platformType);
Debug.Log("ON MESSAGE EVENT: PLAYER: PROJECT ID: " + messageData.player.projectId);
Debug.Log("ON MESSAGE EVENT: PLAYER: SCORE: " + messageData.player.score);
}
You can pay attention to message.target
:
CHANNEL
: a new message appeared in the channelPERSONAL
: someone wrote a private message to the playerFEED
: someone wrote a message in the player's feed
Edit Message
+1 RequestChanging the sent message is implemented using the gp.channels.editMessage
method by the messageId
identifier:
- JavaScript
- Unity
gp.channels.editMessage({ messageId: '638d73ee28520fc3b551a8ac', text: 'Hello!' });
GP_Channels.EditMessage(message_ID: "638d73ee28520fc3b551a8ac", text: "Hello!");
To get the result of a method call, you can subscribe to events:
- JavaScript
- Unity
gp.channels.on('editMessage', (message) => {
// Successfully updated
// The ID of the post, it can be used to edit or delete the post
message.id
// Channel ID
message.channelId
// ID of the author of the message
message.authorId
// Message text
message.text
// Tags of messages
message.tags
// Player Public Fields - Sender of the Message
message.player
// The time of sending the message
message.createdAt
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnEditMessageSuccess += OnEditMessageSuccess;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnEditMessageSuccess -= OnEditMessageSuccess;
}
// Successfully updated
private void OnEditMessageSuccess(GP_Data data)
{
var editMessageData = data.Get<Message_Data>();
Debug.Log("EDIT MESSAGE SUCCESS: CHANNEL ID: " + editMessageData.channelId);
Debug.Log("EDIT MESSAGE SUCCESS: AUTHOR ID: " + editMessageData.authorId);
Debug.Log("EDIT MESSAGE SUCCESS: ID: " + editMessageData.id);
Debug.Log("EDIT MESSAGE SUCCESS: TEXT: " + editMessageData.text);
for (int i = 0; i < editMessageData.tags.Length; i++)
{
Debug.Log("EDIT MESSAGE SUCCESS: TAGS: " + editMessageData.tags[i]);
}
Debug.Log("EDIT MESSAGE SUCCESS: CREATED AT: " + editMessageData.createdAt);
Debug.Log("EDIT MESSAGE SUCCESS: PLAYER: AVATAR " + editMessageData.player.avatar);
Debug.Log("EDIT MESSAGE SUCCESS: PLAYER: CREDITIALS " + editMessageData.player.credentials);
Debug.Log("EDIT MESSAGE SUCCESS: PLAYER: ID " + editMessageData.player.id);
Debug.Log("EDIT MESSAGE SUCCESS: PLAYER: NAME " + editMessageData.player.name);
Debug.Log("EDIT MESSAGE SUCCESS: PLAYER: PLATFORM TYPE " + editMessageData.player.platformType);
Debug.Log("EDIT MESSAGE SUCCESS: PLAYER: PROJECT ID " + editMessageData.player.projectId);
Debug.Log("EDIT MESSAGE SUCCESS: PLAYER: SCORE " + editMessageData.player.score);
}
Execution with an error:
- JavaScript
- Unity
gp.channels.on('error:editMessage', (err) => {
// Completed with an error
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnEditMessageError += OnEditMessageError;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnEditMessageError -= OnEditMessageError;
}
// Completed with an error
private void OnEditMessageError() => Debug.Log("EDIT MESSAGE: ERROR");
Possible errors are shown in the table below:
Basic Errors | Script Errors |
---|---|
player_not_found | channel_message_not_found |
project_not_found | empty_message |
origin_not_allowed | access_denied |
player_banned | message_characters_limit_exceeds |
internal_error |
When a message changes, all players in the channel receive a message change notification:
- JavaScript
- Unity
gp.channels.on('event:editMessage', (message) => {
// Channel ID
message.channelId;
// ID messages
message.id;
// ID of the author of the message
message.authorId;
// Message text
message.text;
// Tags of messages
message.tags;
// The date of sending the message
message.createdAt;
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnEditMessageEvent += OnEditMessageEvent;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnEditMessageEvent -= OnEditMessageEvent;
}
private void OnEditMessageEvent(MessageData data)
{
Debug.Log("EDIT MESSAGE EVENT: CHANNEL ID: " + data.channelId);
Debug.Log("EDIT MESSAGE EVENT: AUTHOR ID: " + data.authorId);
Debug.Log("EDIT MESSAGE EVENT: ID: " + data.id);
Debug.Log("EDIT MESSAGE EVENT: TEXT: " + data.text);
Debug.Log("EDIT MESSAGE EVENT: CREATED AT: " + data.createdAt);
for (int i = 0; i < data.tags.Length; i++)
{
Debug.Log("EDIT MESSAGE EVENT: TAGS: " + data.tags[i]);
}
}
Deleting a Message
+1 RequestDeleting a sent message is implemented using the gp.channels.deleteMessage
method by the messageId
identifier:
- JavaScript
- Unity
gp.channels.deleteMessage({ messageId: '638d73ee28520fc3b551a8ac' });
GP_Channels.DeleteMessage(message_ID: "638d73ee28520fc3b551a8ac");
To get the result of the method call, you can subscribe to events:
- JavaScript
- Unity
gp.channels.on('deleteMessage', () => {
// Successfully deleted
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnDeleteMessageSuccess += OnDeleteMessageSuccess;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnDeleteMessageSuccess -= OnDeleteMessageSuccess;
}
// Successfully deleted
private void OnDeleteMessageSuccess() => Debug.Log("DELETE MESSAGE: Success");
Execution with an error:
- JavaScript
- Unity
gp.channels.on('error:deleteMessage', (err) => {
// Completed with an error
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnDeleteMessageError += OnDeleteMessageError;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnDeleteMessageError -= OnDeleteMessageError;
}
// Completed with an error
private void OnDeleteMessageError() => Debug.Log("DELETE MESSAGE: ERROR");
Possible errors are shown in the table below:
Basic Errors | Script Errors |
---|---|
player_not_found | channel_message_not_found |
project_not_found | access_denied |
origin_not_allowed | |
player_banned | |
internal_error |
When a message is deleted, all players in the channel receive a message deletion notification:
- JavaScript
- Unity
gp.channels.on('event:deleteMessage', (message) => {
// Channel ID
message.channelId;
// ID messages
message.id;
// ID of the author of the message
message.authorId;
// Message text
message.text;
// Tags of messages
message.tags;
// The date of sending the message
message.createdAt;
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnDeleteMessageEvent += OnDeleteMessageEvent;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnDeleteMessageEvent -= OnDeleteMessageEvent;
}
private void OnDeleteMessageEvent(MessageData data)
{
Debug.Log("DELETE MESSAGE EVENT: ID: " + data.id);
Debug.Log("DELETE MESSAGE EVENT: CHANNEL ID: " + data.channelId);
Debug.Log("DELETE MESSAGE EVENT: AUTHOR ID: " + data.authorId);
Debug.Log("DELETE MESSAGE EVENT: TEXT: " + data.text);
Debug.Log("DELETE MESSAGE EVENT: CREATED AT: " + data.createdAt);
for (int i = 0; i < data.tags.Length; i++)
{
Debug.Log("DELETE MESSAGE EVENT: TAGS: " + data.tags[i]);
}
}
Get a List of Messages in the Selected Channel
+1 RequestMandatory access rights Allow to read messages
You can get a list of messages in the selected channel using the gp.channels.fetchMessages
method:
- JavaScript
- Unity
const response = await gp.channels.fetchMessages({
// Channel ID
channelId: 123,
// Tags of messages for filtering, through (&)
tags: ['chat', 'trade'],
// How much to request at a time, Max.100
limit: 100,
// How many records can be missed, Max.10,000, used for page navigation or "load more"
offset: 0
});
GP_Channels.FetchMessages(
// Channel ID
channel_ID: 123,
// Tags of messages for filtering, through (&)
tags: "chat, trade",
// How much to request at a time, Max.100
limit: 100,
// How many records can be missed, Max.10,000, used for page navigation or "load more"
offset: 0
);
Get a list of personal messages with another player:
- JavaScript
- Unity
const response = await gp.channels.fetchPersonalMessages({
// ID of another player
playerId: 123456,
// Tags of messages for filtering, through (&)
tags: ['chat', 'trade'],
// How much to request at a time, Max.100
limit: 100,
// How many records can be missed, Max.10,000, used for page navigation or "load more"
offset: 0
});
GP_Channels.FetchPersonalMessages(
// ID of another player
playerId: 123456,
// Tags of messages for filtering, through (&)
tags: "chat, trade",
// How much to request at a time, Max.100
limit: 100,
// How many records can be missed, Max.10,000, used for page navigation or "load more"
offset: 0
);
Get a list of posts in a player's feed:
- JavaScript
- Unity
const response = await gp.channels.fetchFeedMessages({
// ID player
playerId: 123456,
// Tags of messages for filtering, through(&)
tags: ['chat', 'trade'],
// How much to request at a time, Max.100
limit: 100,
// How many records can be missed, Max.10,000, used for page navigation or "load more"
offset: 0
});
GP_Channels.FetchFeedMessages(
// ID player
playerId: 123456,
// Tags of messages for filtering, through (&)
tags: "chat, trade",
// How much to request at a time, Max.100
limit: 100,
// How many records can be missed, Max.10,000, used for page navigation or "load more"
offset: 0
);
To get the result of the method call, you can subscribe to events:
- JavaScript
- Unity
gp.channels.on('fetchMessages', (result) => {
result.items // An array of the list of messages
result.canLoadMore // Is it possible to load more messages
result.items.forEach((message) => {
// All posts of the message
// ID messages, it can be used to edit or delete a message
message.id
// Channel ID
message.channelId
// ID Player - Author of Message
message.authorId
// Message text
message.text
// Tags of messages
message.tags
// Public fields of the author of the message
message.player
message.player.id
message.player.name
message.player.avatar
// And other public fields
// The date of creation of the message, ISO 8601
message.createdAt
});
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnFetchMessages += OnFetchMessages;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnFetchMessages -= OnFetchMessages;
}
private void OnFetchMessages(GP_Data data, bool canLoadMore)
{
var fetchMessageData = data.GetList<Message_Data>();
Debug.Log("FETCH MESSAGES: CAN LOAD MORE: " + canLoadMore);
for (int i = 0; i < fetchMessageData.Count; i++)
{
_chatUI.text += $"\n {fetchMessageData[i].text}";
Debug.Log("FETCH MESSAGES: CHANNEL ID: " + fetchMessageData[i].channelId);
Debug.Log("FETCH MESSAGES: AUTHOR ID: " + fetchMessageData[i].authorId);
Debug.Log("FETCH MESSAGES: ID " + fetchMessageData[i].id);
Debug.Log("FETCH MESSAGES: TEXT: " + fetchMessageData[i].text);
for (int x = 0; x < fetchMessageData[i].tags.Length; x++)
{
Debug.Log("FETCH MESSAGES: TAGS: " + fetchMessageData[i].tags[x]);
}
Debug.Log("FETCH MESSAGES: CREATED AT: " + fetchMessageData[i].createdAt);
Debug.Log("FETCH MESSAGES: PLAYER: AVATAR: " + fetchMessageData[i].player.avatar);
Debug.Log("FETCH MESSAGES: PLAYER: CREDITIALS: " + fetchMessageData[i].player.credentials);
Debug.Log("FETCH MESSAGES: PLAYER: ID: " + fetchMessageData[i].player.id);
Debug.Log("FETCH MESSAGES: PLAYER: NAME: " + fetchMessageData[i].player.name);
Debug.Log("FETCH MESSAGES: PLAYER: PLATFORM TYPE: " + fetchMessageData[i].player.platformType);
Debug.Log("FETCH MESSAGES: PLAYER: PROJECT ID: " + fetchMessageData[i].player.projectId);
Debug.Log("FETCH MESSAGES: PLAYER: SCORE: " + fetchMessageData[i].player.score);
}
}
Execution with an error:
- JavaScript
- Unity
gp.channels.on('error:fetchMessages', (err) => {
// Completed with an error
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnFetchMessagesError += OnFetchMessagesError;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnFetchMessagesError -= OnFetchMessagesError;
}
private void OnFetchMessagesError() => Debug.Log("FETCH MESSAGES: ERROR");
Possible errors are shown in the table below:
Basic Errors | Script Errors |
---|---|
player_not_found | empty_channel_id |
project_not_found | channel_not_found |
origin_not_allowed | access_denied |
player_banned | |
internal_error |
To additionally fetch messages in a channel for the same request, there is a convenient gp.channels.fetchMoreMessages
method:
- JavaScript
- Unity
const response = await gp.channels.fetchMoreMessages({
// Channel ID
channelId: 123,
// Tags of messages for filtering, through (&)
tags: ['chat', 'trade'],
// How much to request at a time, Max.100
limit: 100,
});
GP_Channels.FetchMoreMessages(
// Channel ID
channel_ID: 123,
// Tags of messages for filtering, through (&)
tags: "chat, trade",
// How much to request at a time, Max.100
limit: 100
);
To additionally fetch personal messages for the same request, there is a convenient method gp.channels.fetchMorePersonalMessages
:
- JavaScript
- Unity
const response = await gp.channels.fetchMorePersonalMessages({
// ID of another player
playerId: 123456,
// Tags of messages for filtering, through (&)
tags: ['chat', 'trade'],
// How much to request at a time, Max.100
limit: 100,
});
GP_Channels.FetchMorePersonalMessages(
// ID of another player
playerId: 123456,
// Tags of messages for filtering, through (&)
tags: "chat, trade",
// How much to request at a time, Max.100
limit: 100
);
To additionally fetch messages in the feed for the same request, there is a convenient method gp.channels.fetchMoreFeedMessages
:
- JavaScript
- Unity
const response = await gp.channels.fetchMoreFeedMessages({
// ID player
playerId: 123456,
// Tags of messages for filtering, through (&)
tags: ['chat', 'trade'],
// How much to request at a time, Max.100
limit: 100,
});
GP_Channels.FetchMoreFeedMessages(
// ID player
playerId: 123456,
// Tags of messages for filtering, through (&)
tags: "chat, trade",
// How much to request at a time, Max.100
limit: 100
);
To get the result of the method call, you can subscribe to events:
- JavaScript
- Unity
gp.channels.on('fetchMoreMessages', (result) => {
result.items //An array of the list of messages
result.canLoadMore //Is it possible to load more messages
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnFetchMoreMessages += OnFetchMoreMessages;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnFetchMoreMessages -= OnFetchMoreMessages;
}
private void OnFetchMoreMessages(GP_Data data, bool canLoadMore)
{
var fetchMoreMessageData = data.GetList<Message_Data>();
Debug.Log("FETCH MORE MESSAGES: CAN LOAD MORE: " + canLoadMore);
for (int i = 0; i < fetchMoreMessageData.Count; i++)
{
Debug.Log("FETCH MORE MESSAGES: CHANNEL ID: " + fetchMoreMessageData[i].channelId);
Debug.Log("FETCH MORE MESSAGES: AUTHOR ID: " + fetchMoreMessageData[i].authorId);
Debug.Log("FETCH MORE MESSAGES: ID: " + fetchMoreMessageData[i].id);
Debug.Log("FETCH MORE MESSAGES: TEXT: " + fetchMoreMessageData[i].text);
for (int x = 0; x < fetchMoreMessageData[i].tags.Length; x++)
{
Debug.Log("FETCH MORE MESSAGES: TAGS: " + fetchMoreMessageData[i].tags[x]);
}
Debug.Log("FETCH MORE MESSAGES: CREATED AT: " + fetchMoreMessageData[i].createdAt);
Debug.Log("FETCH MORE MESSAGES: PLAYER: AVATAR: " + fetchMoreMessageData[i].player.avatar);
Debug.Log("FETCH MORE MESSAGES: PLAYER: CREDITIALS: " + fetchMoreMessageData[i].player.credentials);
Debug.Log("FETCH MORE MESSAGES: PLAYER: ID: " + fetchMoreMessageData[i].player.id);
Debug.Log("FETCH MORE MESSAGES: PLAYER: NAME: " + fetchMoreMessageData[i].player.name);
Debug.Log("FETCH MORE MESSAGES: PLAYER: PLATFORM TYPE: " + fetchMoreMessageData[i].player.platformType);
Debug.Log("FETCH MORE MESSAGES: PLAYER: PROJECT ID: " + fetchMoreMessageData[i].player.projectId);
Debug.Log("FETCH MORE MESSAGES: PLAYER: SCORE: " + fetchMoreMessageData[i].player.score);
}
}
Execution with an error:
- JavaScript
- Unity
gp.channels.on('error:fetchMoreMessages', (err) => {
// Completed with an error
});
// subscribe to event
private void OnEnable()
{
GP_Channels.OnFetchMoreMessagesError += OnFetchMoreMessagesError;
}
// unsubscribe from event
private void OnDisable()
{
GP_Channels.OnFetchMoreMessagesError -= OnFetchMoreMessagesError;
}
// Completed with an error
private void OnFetchMoreMessagesError() => Debug.Log("FETCH MORE MESSAGES: ERROR");
Possible errors are shown in the table below:
Basic Errors | Script Errors |
---|---|
player_not_found | empty_channel_id |
project_not_found | channel_not_found |
origin_not_allowed | access_denied |
player_banned | |
internal_error |
Stay in Touch
Other documents of this chapter available Here. To get started, welcome to the Tutorials chapter.
GamePush Community Telegram
: @gs_community.
For your suggestions e-mail
: [email protected]
We Wish you Success!