NIMSDK-iOS
载入中...
搜索中...
未找到
NIMQChatApnsManagerProtocol.h
浏览该文件的文档.
1//
2// NIMQChatApnsManagerProtocol.h
3// NIMLib
4//
5// Created by Netease.
6// Copyright © 2022 Netease. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "NIMQChatDefs.h"
13#import "NIMQChatDefs.h"
14
18NS_ASSUME_NONNULL_BEGIN
19
20/**
21 * 圈组获取用户推送配置回调
22 *
23 * @param error 错误信息
24 * @param config 配置信息
25 */
26typedef void(^NIMQChatGetUserPushNotificationConfigHandler)(NSError *__nullable error,
27 NSArray<NIMQChatUserPushNotificationConfig *> *__nullable config);
28
29/**
30 * 推送委托
31 */
32@protocol NIMQChatApnsManagerDelegate <NSObject>
33
34@optional
35
36@end
37
38/**
39 * 推送协议
40 */
41@protocol NIMQChatApnsManager <NSObject>
42/**
43 * 获取当前的推送免打扰设置
44 *
45 * @return 推送设置
46 */
47- (nullable NIMPushNotificationSetting *)currentSetting;
48
49/**
50 * 更新推送免打扰设置
51 *
52 * @param setting 推送设置
53 * @param completion 完成的回调
54 */
55- (void)updateApnsSetting:(NIMPushNotificationSetting *)setting
56 completion:(nullable NIMApnsHandler)completion;
57
58/**
59 * 注册获取 badge 数量的回调函数
60 *
61 * @param handler 获取 badge 回调
62 * @discussion 默认场景下,云信会将所有未读数量统一汇报给服务器,包括需要提醒和不需要提醒的会话未读数,上层可以通过注册该接口进行调整
63 */
64- (void)registerBadgeCountHandler:(NIMBadgeHandler)handler;
65
66/**
67 * 更新服务器推送消息等级配置
68 *
69 * @param profile 推送消息等级配置
70 * @param serverId 服务器ID
71 * @param completion 完成的回调
72 */
73- (void)updatePushNotificationProfile:(NIMPushNotificationProfile)profile
74 server:(unsigned long long)serverId
75 completion:(nullable NIMQChatHandler)completion;
76
77/**
78 * 更新频道推送消息等级配置
79 *
80 * @param profile 推送消息等级配置
81 * @param channelIdInfo 频道ID信息
82 * @param completion 完成的回调
83 */
84- (void)updatePushNotificationProfile:(NIMPushNotificationProfile)profile
85 channel:(NIMQChatChannelIdInfo *)channelIdInfo
86 completion:(nullable NIMQChatHandler)completion;
87
88/**
89 * 更新频道分组推送消息等级配置
90 *
91 * @param profile 推送消息等级配置
92 * @param categoryIdInfo 频道分组ID信息
93 * @param completion 完成的回调
94 */
95- (void)updatePushNotificationProfile:(NIMPushNotificationProfile)profile
96 channelCategory:(NIMQChatChannelCategoryIdInfo *)categoryIdInfo
97 completion:(nullable NIMQChatHandler)completion;
98
99/**
100 * 获取服务器维度用户推送配置
101 *
102 * @param serverIds 服务器ID数组
103 * @param completion 完成的回调
104 * @discussion 限制单次查询服务器数量为10
105 */
106- (void)getUserPushNotificationConfigByServer:(NSArray<NSNumber *> *)serverIds
107 completion:(nullable NIMQChatGetUserPushNotificationConfigHandler)completion;
108
109/**
110 * 获取频道维度用户推送配置
111 *
112 * @param channelIdInfo 频道ID信息数组
113 * @param completion 完成的回调
114 * @discussion 限制单次查询频道数量为10
115 */
116- (void)getUserPushNotificationConfigByChannel:(NSArray<NIMQChatChannelIdInfo *> *)channelIdInfo
117 completion:(nullable NIMQChatGetUserPushNotificationConfigHandler)completion;
118/**
119 * 获取频道分组维度用户推送配置
120 *
121 * @param categoryIdInfo 频道分组ID信息数组
122 * @param completion 完成的回调
123 * @discussion 限制单次查询频道数量为10
124 */
125- (void)getUserPushNotificationConfigByChannelCategories:(NSArray<NIMQChatChannelCategoryIdInfo *> *)categoryIdInfos
126 completion:(nullable NIMQChatGetUserPushNotificationConfigHandler)completion;
127/**
128 * 添加委托
129 *
130 * @param delegate 委托
131 */
132- (void)addDelegate:(id<NIMQChatApnsManagerDelegate>)delegate;
133
134
135/**
136 * 移除委托
137 *
138 * @param delegate 委托
139 */
140- (void)removeDelegate:(id<NIMQChatApnsManagerDelegate>)delegate;
141
142@end
143
144NS_ASSUME_NONNULL_END
NSUInteger(^ NIMBadgeHandler)(void)
Definition: NIMApnsManagerProtocol.h:28
void(^ NIMApnsHandler)(NSError *__nullable error)
Definition: NIMApnsManagerProtocol.h:21
NIMPushNotificationProfile
Definition: NIMPushNotificationSetting.h:31
NS_ASSUME_NONNULL_BEGIN typedef void(^ NIMQChatGetUserPushNotificationConfigHandler)(NSError *__nullable error, NSArray< NIMQChatUserPushNotificationConfig * > *__nullable config)
void(^ NIMQChatHandler)(NSError *__nullable error)
Definition: NIMQChatDefs.h:276
Definition: NIMPushNotificationSetting.h:66
Definition: NIMQChatChannelCategoryIdInfo.h:16
Definition: NIMQChatChannelIdInfo.h:15
Definition: NIMQChatUserPushNotificationConfig.h:37