[TOC]
//-- Async Method
public bool AddAttributes(DoneDelegate callback, Dictionary<string, string> attrs, int timeout = 0);
//-- Sync Method
public int AddAttributes(Dictionary<string, string> attrs, int timeout = 0);
Add session or connection attributes. That can be fetch by all sessions of the user.
Parameters:
-
DoneDelegate callbackpublic delegate void DoneDelegate(int errorCode);Callabck for async method. Please refer DoneDelegate.
-
Dictionary<string, string> attrsSession or connection attributes. That can be fetch by all sessions of the user.
-
int timeoutTimeout in second.
0 means using default setting.
Return Values:
-
bool for Async
- true: Async calling is start.
- false: Start async calling is failed.
-
int for Sync
0 or com.fpnn.ErrorCode.FPNN_EC_OK means calling successed.
Others are the reason for calling failed.
//-- Async Method
public bool GetAttributes(Action<Dictionary<string, string>, int> callback, int timeout = 0);
//-- Sync Method
public int GetAttributes(out Dictionary<string, string> attributes, int timeout = 0);
Get session or connection attributes.
Parameters:
-
Action<Dictionary<string, string>, int> callbackCallabck for async method.
FirstDictionary<string, string>is the attributes dictionary for current session;
Secondintis the error code indicating the calling is successful or the failed reasons. -
out Dictionary<string, string> attributesAttributes dictionary for current session.
-
int timeoutTimeout in second.
0 means using default setting.
Return Values:
-
bool for Async
- true: Async calling is start.
- false: Start async calling is failed.
-
int for Sync
0 or com.fpnn.ErrorCode.FPNN_EC_OK means calling successed.
Others are the reason for calling failed.
//-- Async Method
public bool AddDebugLog(DoneDelegate callback, string message, string attrs, int timeout = 0);
//-- Sync Method
public int AddDebugLog(string message, string attrs, int timeout = 0);
Add debug log.
Parameters:
-
DoneDelegate callbackpublic delegate void DoneDelegate(int errorCode);Callabck for async method. Please refer DoneDelegate.
-
string messagelog text.
-
string attrsAttributes for log text.
-
int timeoutTimeout in second.
0 means using default setting.
Return Values:
-
bool for Async
- true: Async calling is start.
- false: Start async calling is failed.
-
int for Sync
0 or com.fpnn.ErrorCode.FPNN_EC_OK means calling successed.
Others are the reason for calling failed.
//-- Async Method
public bool AddDevice(DoneDelegate callback, string appType, string deviceToken, int timeout = 0);
//-- Sync Method
public int AddDevice(string appType, string deviceToken, int timeout = 0);
Add device infos.
Parameters:
-
DoneDelegate callbackpublic delegate void DoneDelegate(int errorCode);Callabck for async method. Please refer DoneDelegate.
-
string appTypeApplication information. apns or fcm
-
string deviceTokeDevice Token
-
int timeoutTimeout in second.
0 means using default setting.
Return Values:
-
bool for Async
- true: Async calling is start.
- false: Start async calling is failed.
-
int for Sync
0 or com.fpnn.ErrorCode.FPNN_EC_OK means calling successed.
Others are the reason for calling failed.
//-- Async Method
public bool RemoveDevice(DoneDelegate callback, string deviceToken, int timeout = 0);
//-- Sync Method
public int RemoveDevice(string deviceToken, int timeout = 0);
Remove device infos.
Parameters:
-
DoneDelegate callbackpublic delegate void DoneDelegate(int errorCode);Callabck for async method. Please refer DoneDelegate.
-
string deviceTokeDevice Token
-
int timeoutTimeout in second.
0 means using default setting.
Return Values:
-
bool for Async
- true: Async calling is start.
- false: Start async calling is failed.
-
int for Sync
0 or com.fpnn.ErrorCode.FPNN_EC_OK means calling successed.
Others are the reason for calling failed.
//-- Async Method
public bool AddDevicePushOption(DoneDelegate callback, MessageCategory messageCategory, long targetId, HashSet<byte> mTypes = null, int timeout = 0);
//-- Sync Method
public int AddDevicePushOption(MessageCategory messageCategory, long targetId, HashSet<byte> mTypes = null, int timeout = 0);
Set disabled session for chat & messages push.
Parameters:
-
DoneDelegate callbackpublic delegate void DoneDelegate(int errorCode);Callabck for async method. Please refer DoneDelegate.
-
MessageCategory messageCategoryOnly
MessageCategory.P2PMessage&MessageCategory.GroupMessagecan be used. -
long targetIdPeer uid for
MessageCategory.P2PMessageand group id forMessageCategory.GroupMessage. -
HashSet<byte> mTypesDisabled message types. If
mTypesisnullor empty, means all message types are disalbed for push. -
int timeoutTimeout in second.
0 means using default setting.
Return Values:
-
bool for Async
- true: Async calling is start.
- false: Start async calling is failed.
-
int for Sync
0 or com.fpnn.ErrorCode.FPNN_EC_OK means calling successed.
Others are the reason for calling failed.
//-- Async Method
public bool RemoveDevicePushOption(DoneDelegate callback, MessageCategory messageCategory, long targetId, HashSet<byte> mTypes = null, int timeout = 0);
//-- Sync Method
public int RemoveDevicePushOption(MessageCategory messageCategory, long targetId, HashSet<byte> mTypes = null, int timeout = 0);
Remove disabled option for chat & messages push.
Parameters:
-
DoneDelegate callbackpublic delegate void DoneDelegate(int errorCode);Callabck for async method. Please refer DoneDelegate.
-
MessageCategory messageCategoryOnly
MessageCategory.P2PMessage&MessageCategory.GroupMessagecan be used. -
long targetIdPeer uid for
MessageCategory.P2PMessageand group id forMessageCategory.GroupMessage. -
HashSet<byte> mTypesDisabled message types. If
mTypesisnullor empty, means all message types are removed disalbe attributes for push. -
int timeoutTimeout in second.
0 means using default setting.
Return Values:
-
bool for Async
- true: Async calling is start.
- false: Start async calling is failed.
-
int for Sync
0 or com.fpnn.ErrorCode.FPNN_EC_OK means calling successed.
Others are the reason for calling failed.
//-- Async Method
public bool GetDevicePushOption(Action<Dictionary<long, HashSet<byte>>, Dictionary<long, HashSet<byte>>, int> callback, int timeout = 0);
//-- Sync Method
public int GetDevicePushOption(out Dictionary<long, HashSet<byte>> p2pDictionary, out Dictionary<long, HashSet<byte>> groupDictionary, int timeout = 0);
Get disabled option for chat & messages push.
Parameters:
-
Action<Dictionary<long, HashSet<byte>>, Dictionary<long, HashSet<byte>>, int> callbackCallabck for async method.
FirstDictionary<long, HashSet<byte>>is peer user id with associated disabled message types set for P2P sessions;
SecondDictionary<long, HashSet<byte>>is group id with associated disabled message types set for group sessions;
Thridintis the error code indicating the calling is successful or the failed reasons. -
out Dictionary<long, HashSet<byte>> p2pDictionaryPeer user id with associated disabled message types set dictionary.
-
out Dictionary<long, HashSet<byte>> groupDictionaryGroup id with associated disabled message types set dictionary.
-
int timeoutTimeout in second.
0 means using default setting.
Return Values:
-
bool for Async
- true: Async calling is start.
- false: Start async calling is failed.
-
int for Sync
0 or com.fpnn.ErrorCode.FPNN_EC_OK means calling successed.
Others are the reason for calling failed.