NIMSession.h
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//
// NIMSession.h
// NIMLib
//
// Created by Netease.
// Copyright (c) 2015 Netease. All rights reserved.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/**
* 会话类型
*/
typedef NS_ENUM(NSInteger, NIMSessionType){
/**
* 点对点
*/
NIMSessionTypeP2P = 0,
/**
* 群组
*/
NIMSessionTypeTeam = 1,
/**
* 聊天室
*/
NIMSessionTypeChatroom = 2
};
/**
* 会话对象
*/
@interface NIMSession : NSObject<NSCopying>
/**
* 会话ID,如果当前session为team,则sessionId为teamId,如果是P2P则为对方帐号
*/
@property (nonatomic,copy,readonly) NSString *sessionId;
/**
* 会话类型,当前仅支持P2P,Team和Chatroom
*/
@property (nonatomic,assign,readonly) NIMSessionType sessionType;
/**
* 通过id和type构造会话对象
*
* @param sessionId 会话ID
* @param sessionType 会话类型
*
* @return 会话对象实例
*/
+ (instancetype)session:(NSString *)sessionId
type:(NIMSessionType)sessionType;
@end
NS_ASSUME_NONNULL_END