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