GroupGetPendencyList

introduction

Get group pendency list

Group pendency contains all group related operations that requires certain permissions. Eg. group joining pendency, group invitation and so on. Even if it is handled (granted/rejected), the pendency can be retrieved by this API and it has handled flag.

UserA applied to groupA, the group owner or admin get retrieve this pendency, because it is determined by the group owner or admin.

If adminA invited userA to groupA, userA can retrieve the pendency because it is determined by userA.

Permission description

Only pendency handlers can retrieve unresolved pendency.

Set group_pendency_option_start_time for start time, input 0 at first and fill out later by returned group_pendency_result_next_start_time in GroupPendencyResult.

Use group_pendency_option_max_limited to set maximum number of pendencies, the server may return less number than this and don't use this as finished flag.

Parameter details

overload1

Parameter name Parameter type Required Description
json_group_getpendence_list_param GroupPendencyOption Required GroupPendencyOption
callback ValueCallback< GroupPendencyResult > Required Asynchronous callback The format of json_param in the return value is json

overload2

Parameter name Parameter type Required Description
json_group_getpendence_list_param GroupPendencyOption Required GroupPendencyOption
callback ValueCallback< string > Required Asynchronous callback The format of json_param in the return value is string

Returned template

TIMResult

The parameters of the callback function after successfully calling the API:
code:int
desc:string
json_param:
'{
  "group_pendency_result_next_start_time" : 0,
  "group_pendency_result_pendency_array" : [
      {
        "group_pendency_add_time" : 1551414487947,
        "group_pendency_apply_invite_msg" : "Want Join Group, Thank you",
        "group_pendency_approval_msg" : "",
        "group_pendency_form_identifier" : "user2",
        "group_pendency_form_user_defined_data" : "",
        "group_pendency_group_id" : "four group id",
        "group_pendency_handle_result" : 0,
        "group_pendency_handled" : 0,
        "group_pendency_pendency_type" : 0,
        "group_pendency_to_identifier" : "user1",
        "group_pendency_to_user_defined_data" : ""
      }
  ],
  "group_pendency_result_read_time_seq" : 0,
  "group_pendency_result_unread_num" : 1
}' // For the meaning of Json Key, please refer to [GroupPendencyResult]
user_data:string

Return value details

name type description
TIMResult TIMResult Return value of calling API
code int Result error code: Error Codes
desc string The description of the error.
json_param string Json string. Calling different API will get different Json strings. For the meaning of Json Key, please refer to GroupPendencyResult
user_data string User-defined data transfered by ImSDK without any processing

Code example

using UnityEngine;
using UnityEngine.UI;
using com.tencent.im.unity.demo.types;
using com.tencent.imsdk.unity;
using com.tencent.imsdk.unity.types;
using com.tencent.imsdk.unity.enums;
using System;
using com.tencent.im.unity.demo.utils;
using EasyUI.Toast;
using System.Collections;
using System.Collections.Generic;
public class GroupGetPendencyList : MonoBehaviour
{
  public Text Header;
  public Text LastSeq;
  public Text Result;
  public Button Submit;
  public Button Copy;
  void Start()
  {
    Header = GameObject.Find("HeaderText").GetComponent<Text>();
    LastSeq = GameObject.Find("LastSeq").GetComponent<Text>();
    LastSeq.text = "0";
    Result = GameObject.Find("ResultText").GetComponent<Text>();
    Submit = GameObject.Find("Submit").GetComponent<Button>();
    Copy = GameObject.Find("Copy").GetComponent<Button>();
    Copy.GetComponentInChildren<Text>().text = Utils.t("Copy");
    Submit.onClick.AddListener(GroupGetPendencyListSDK);
    Copy.onClick.AddListener(CopyText);
    if (CurrentSceneInfo.info != null)
    {
      Header.text = Utils.IsCn() ? CurrentSceneInfo.info.apiText + " " + CurrentSceneInfo.info.apiName : CurrentSceneInfo.info.apiName;
      Submit.GetComponentInChildren<Text>().text = CurrentSceneInfo.info.apiName;
    }
  }

  void GroupGetPendencyListSDK()
  {
    GroupPendencyOption param = new GroupPendencyOption
    {
      group_pendency_option_start_time = Convert.ToUInt64(LastSeq.text)
    };
    TIMResult res = TencentIMSDK.GroupGetPendencyList(param, Utils.addAsyncStringDataToScreen(GetResult));
    Result.text = Utils.SynchronizeResult(res);
  }

  void GetResult(params object[] parameters)
  {
    Result.text += (string)parameters[0];
    string text = (string)parameters[1];
    var res = Utils.FromJson<GroupPendencyResult>(text);
    LastSeq.text = res.group_pendency_result_next_start_time.ToString();
  }

  void CopyText()
  {
    Utils.Copy(Result.text);
  }
  void OnApplicationQuit()
  {
    TencentIMSDK.Uninit();
  }
}

results matching ""

    No results matching ""