NIMSDK-iOS
载入中...
搜索中...
未找到
NIMSession.h
浏览该文件的文档.
1//
2// NIMSession.h
3// NIMLib
4//
5// Created by Netease.
6// Copyright (c) 2015 Netease. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11NS_ASSUME_NONNULL_BEGIN
12
13
14/**
15 * 会话类型
16 */
17typedef NS_ENUM(NSInteger, NIMSessionType){
18 /**
19 * 点对点
20 */
22 /**
23 * 群组
24 */
26 /**
27 * 聊天室
28 */
30 /**
31 * 云商服
32 */
34 /**
35 * 超大群
36 */
38
39 /**
40 * 圈组
41 */
43};
44
45
46/**
47 * 会话对象
48 */
49@interface NIMSession : NSObject<NSCopying>
50
51/**
52 * 会话ID,如果当前session为team,则sessionId为teamId,如果是P2P则为对方帐号
53 */
54@property (nonatomic,copy,readonly) NSString *sessionId;
55
56/**
57 * 会话类型,当前仅支持P2P,Team和Chatroom
58 */
59@property (nonatomic,assign,readonly) NIMSessionType sessionType;
60
61/**
62 * 圈组频道ID
63 */
64@property (nonatomic,readonly) unsigned long long qchatChannelId;
65
66/**
67 * 圈组服务器ID
68 */
69@property (nonatomic,readonly) unsigned long long qchatServerId;
70
71/**
72 * 通过id和type构造会话对象
73 *
74 * @param sessionId 会话ID
75 * @param sessionType 会话类型
76 *
77 * @return 会话对象实例
78 */
79+ (instancetype)session:(NSString *)sessionId
80 type:(NIMSessionType)sessionType;
81
82/**
83 * 通过圈组频道ID和圈组服务器ID构造会话对象
84 *
85 * @param qchatChannelId 圈组频道ID
86 * @param qchatServerId 圈组服务器ID
87 *
88 * @return 会话对象实例
89 */
90+ (instancetype)sessionForQChat:(long long)qchatChannelId
91 qchatServerId:(long long)qchatServerId;
92
93+ (nullable instancetype)sessionFromString:(NSString *)sessionString;
94@end
95
96NS_ASSUME_NONNULL_END
97
NIMSessionType
Definition: NIMSession.h:17
@ NIMSessionTypeChatroom
Definition: NIMSession.h:29
@ NIMSessionTypeQChat
Definition: NIMSession.h:42
@ NIMSessionTypeTeam
Definition: NIMSession.h:25
@ NIMSessionTypeYSF
Definition: NIMSession.h:33
@ NIMSessionTypeP2P
Definition: NIMSession.h:21
@ NIMSessionTypeSuperTeam
Definition: NIMSession.h:37
Definition: NIMSession.h:49
unsigned long long qchatChannelId
Definition: NIMSession.h:64
NIMSessionType sessionType
Definition: NIMSession.h:59
NSString * sessionId
Definition: NIMSession.h:54
unsigned long long qchatServerId
Definition: NIMSession.h:69