Client Mail API Reference
Mail is a service that helps developers send in-game mails with attachments to players asynchronously through the PGOS web portal or virtual server. Game client can pull mails, mark mails, delete mails and claim the attachment in mails.
API List
| API | Description |
|---|---|
| GetMailList | Get mail list by category, category 'All' represents all categories. |
| DeleteMailById | Delete mail by mail ID. |
| DeleteReadMailByCategory | Delete read mails by category. |
| MarkMailAsReadById | Mark mail as read by id. |
| MarkMailAsReadByCategory | Mark mail as read by category. |
| ClaimMailAttachmentById | Claim mail attachments by mail ID. |
| ClaimMailAttachmentByCategory | Claim mail attachments by category. |
| GetMailBadgeNum | Get the number of unread mails. |
Event List
| Event | Description |
|---|---|
| OnBadgeNumOfMail | The event will be triggered when player login PGOS or the total unread count of mails changes. |
| OnReceiveNewMail | The event will be triggered when a new mail is received. |
API Details
GetMailList
Get mail list by category, category 'All' represents all categories.
/// <summary>Get mail list by category, category 'All' represents all categories.</summary>
/// <param name="pgos_params">Request parameters for get mail list.</param>
public void GetMailList(GetMailListParams pgos_params, MailDelegate0 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| pgos_params | GetMailListParams | Request parameters for get mail list. |
| callback | MailDelegate0 |
Return: void
DeleteMailById
Delete mail by mail ID.
/// <summary>Delete mail by mail ID.</summary>
/// <param name="mail_ids">Mail IDs.</param>
public void DeleteMailById(List<string> mail_ids, MailDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| mail_ids | List<string> | Mail IDs. |
| callback | MailDelegate1 |
Return: void
DeleteReadMailByCategory
Delete read mails by category.
/// <summary>Delete read mails by category.</summary>
/// <param name="category">Mail category, category 'All' represents all categories.</param>
public void DeleteReadMailByCategory(MailCategory category, MailDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| category | MailCategory | Mail category, category 'All' represents all categories. |
| callback | MailDelegate1 |
Return: void
MarkMailAsReadById
Mark mail as read by id.
/// <summary>Mark mail as read by id.</summary>
/// <param name="mail_ids">Mail IDs.</param>
public void MarkMailAsReadById(List<string> mail_ids, MailDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| mail_ids | List<string> | Mail IDs. |
| callback | MailDelegate1 |
Return: void
MarkMailAsReadByCategory
Mark mail as read by category.
/// <summary>Mark mail as read by category.</summary>
/// <param name="category">Mail category, category 'All' represents all categories.</param>
public void MarkMailAsReadByCategory(MailCategory category, MailDelegate1 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| category | MailCategory | Mail category, category 'All' represents all categories. |
| callback | MailDelegate1 |
Return: void
ClaimMailAttachmentById
Claim mail attachments by mail ID.
/// <summary>Claim mail attachments by mail ID.</summary>
/// <param name="mail_ids">Mail IDs.</param>
public void ClaimMailAttachmentById(List<string> mail_ids, MailDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| mail_ids | List<string> | Mail IDs. |
| callback | MailDelegate2 |
Return: void
ClaimMailAttachmentByCategory
Claim mail attachments by category.
/// <summary>Claim mail attachments by category.</summary>
/// <param name="category">Mail category, category 'All' represents all categories.</param>
public void ClaimMailAttachmentByCategory(MailCategory category, MailDelegate2 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| category | MailCategory | Mail category, category 'All' represents all categories. |
| callback | MailDelegate2 |
Return: void
GetMailBadgeNum
Get the number of unread mails.
/// <summary>Get the number of unread mails.</summary>
public void GetMailBadgeNum(MailDelegate3 callback);
Parameters:
| Param | Type | Description |
|---|---|---|
| callback | MailDelegate3 |
Return: void
Event Details
OnBadgeNumOfMail
The event will be triggered when player login PGOS or the total unread count of mails changes.
/// <summary>The event will be triggered when player login PGOS or the total unread count of mails changes.</summary>
public event MailDelegate4 OnBadgeNumOfMail;
Type Reference:
OnReceiveNewMail
The event will be triggered when a new mail is received.
/// <summary>The event will be triggered when a new mail is received.</summary>
public event MailDelegate5 OnReceiveNewMail;
Type Reference:
All Delegates
public delegate void MailDelegate0(PgosResult a0, GetMailListResult a1);
public delegate void MailDelegate1(PgosResult a0);
public delegate void MailDelegate2(PgosResult a0, ClaimMailAttachmentResult a1);
public delegate void MailDelegate3(PgosResult a0, GetMailBadgeNumResult a1);
public delegate void MailDelegate4(BadgeNumOfMailEvt a0);
public delegate void MailDelegate5(ReceiveNewMailEvt a0);
Type Reference: