[TOC]
C# .Net Standard 2.0
using com.fpnn.rtm;
Init MUST in the main thread.
using com.fpnn;
ClientEngine.Init();
ClientEngine.Init(Config config);
using com.fpnn.rtm;
RTMControlCenter.Init();
RTMControlCenter.Init(RTMConfig config);
RTMClient client = RTMClient.getInstance(string endpoint, long pid, long uid, RTMQuestProcessor serverPushProcessor);
Please get your project params from RTM Console.
public int ConnectTimeout;
public int QuestTimeout;
public com.fpnn.common.ErrorRecorder ErrorRecorder;
//-- Async interfaces
public bool Login(AuthDelegate callback, string token, int timeout = 0);
public bool Login(AuthDelegate callback, string token, Dictionary<string, string> attr, TranslateLanguage language = TranslateLanguage.None, int timeout = 0);
//-- Sync interfaces
public int RTMClient.Login(out bool ok, string token, int timeout = 0);
public int RTMClient.Login(out bool ok, string token, Dictionary<string, string> attr, TranslateLanguage language = TranslateLanguage.None, int timeout = 0);
-
Send P2P Message
//-- Async interface public bool SendMessage(MessageIdDelegate callback, long uid, byte mtype, string message, string attrs = "", int timeout = 0); //-- Sync interface public int SendMessage(out long messageId, long uid, byte mtype, string message, string attrs = "", int timeout = 0);
-
Send Group Message
//-- Async interface public bool SendGroupMessage(MessageIdDelegate callback, long groupId, byte mtype, string message, string attrs = "", int timeout = 0); //-- Sync interface public int SendGroupMessage(out long messageId, long groupId, byte mtype, string message, string attrs = "", int timeout = 0);
-
Send Room Message
//-- Async interface public bool SendRoomMessage(MessageIdDelegate callback, long roomId, byte mtype, string message, string attrs = "", int timeout = 0); //-- Sync interface public int SendRoomMessage(out long messageId, long roomId, byte mtype, string message, string attrs = "", int timeout = 0);
-
Send P2P Chat
//-- Async interface public bool SendChat(MessageIdDelegate callback, long uid, string message, string attrs = "", int timeout = 0); //-- Sync interface public int SendChat(out long messageId, long uid, string message, string attrs = "", int timeout = 0);
-
Send Group Chat
//-- Async interface public bool SendGroupChat(MessageIdDelegate callback, long groupId, string message, string attrs = "", int timeout = 0); //-- Sync interface public int SendGroupChat(out long messageId, long groupId, string message, string attrs = "", int timeout = 0);
-
Send Room Chat
//-- Async interface public bool SendRoomChat(MessageIdDelegate callback, long roomId, string message, string attrs = "", int timeout = 0); //-- Sync interface public int SendRoomChat(out long messageId, long roomId, string message, string attrs = "", int timeout = 0);
using com.fpnn.rtm;
RTCEngine.Init();
client = LoginRTM(endpoint, pid, uid, token);
RTCEngine.ActiveRTCClient(client);
client.CreateRTCRoom((long roomId, int errorCode) =>
{
if (errorCode == com.fpnn.ErrorCode.FPNN_EC_OK)
{
RTCEngine.setActiveRoomId(roomID);
}
else
{
client.EnterRTCRoom((long tmpRoomId, RTCRoomType roomType, int tmpErrorCode) =>
{
RTCEngine.setActiveRoomId(tmpRoomId);
}, roomID);
}
}, roomID, RTCRoomType.VoiceRoom);
client.ExitRTCRoom((int errorCode) =>
{
}, roomID);
Unity `Debug.Log("com.fpnn.rtm.RTMConfig.SDKVersion");`
Please refer: API docs
Please refer: Package release docs
-
<rtm-client-sdk-unity>/Assets/Plugins/fpnn
Codes of FPNN SDK.
-
<rtm-client-sdk-unity>/Assets/Plugins/rtm
Codes of RTM SDK.
-
<rtm-client-sdk-unity>/Assets/Examples
Examples codes for using RTM SDK.
-
<rtm-client-sdk-unity>/Assets/
-
Main.cs:
Entery of all examples.
-
ErrorRecorder.cs:
Demo implementation of com.fpnn.common.ErrorRecorder for all examples.
-
RTMExampleQuestProcessor.cs:
Demo implementation of com.fpnn.rtm.IRTMQuestProcessor for all examples.
-
-
<rtm-client-sdk-unity>/doc
API documents in markdown format.