floo2
bmx_push_service.h
1 //-------------------------------------------------------------------------------------------------
2 // File : bmx_push_service.h
3 // Author : Eric Liang <eric@bmxlabs.com>
4 // Purpose : bmx chat service define file.
5 // Created : 13 July 2020 by Eric Liang <eric@bmxlabs.com>
6 //-------------------------------------------------------------------------------------------------
7 //
8 // Copyright (C) 2018-2019 MaxIM.Top
9 //
10 // You may obtain a copy of the licence at http://www.maxim.top/LICENCE-MAXIM.md
11 //
12 //-------------------------------------------------------------------------------------------------
13 
14 #ifndef bmx_push_service_h
15 #define bmx_push_service_h
16 
17 #include "bmx_message.h"
18 #include "bmx_error.h"
19 #include "bmx_push_user_profile.h"
20 
21 namespace floo {
22 
23 class BMXPushServiceListener;
24 
25 class EXPORT_API BMXPushService {
26 public:
27 
31  enum class PushSdkStatus {
33  Starting = 1,
35  Started,
37  Stoped,
39  Offline
40  };
41 
45  enum class PushDirection {
47  Up,
49  Down
50  };
51 
52  virtual ~BMXPushService() {}
53 
60  virtual BMXErrorCode start(const std::string& alias = "", const std::string& bmxToken = "") = 0;
61 
66  virtual BMXErrorCode stop() = 0;
67 
72  virtual BMXErrorCode resume() = 0;
73 
79  virtual BMXErrorCode unbindAlias(const std::string& alias) = 0;
80 
85  virtual const std::string& getToken() = 0;
86 
91  virtual const std::string& getCert() = 0;
92 
97  virtual PushSdkStatus status() = 0;
98 
104  virtual BMXErrorCode bindDeviceToken(const std::string& token) = 0;
105 
111  virtual BMXErrorCode bindVoipToken(const std::string& token) = 0;
112 
119  virtual BMXErrorCode getPushProfile(BMXPushUserProfilePtr& pushProfile, bool forceRefresh) = 0;
120 
127  virtual BMXErrorCode setTags(const std::vector<std::string>& tags, const std::string& operationId) = 0;
128 
135  virtual BMXErrorCode getTags(std::vector<std::string>& tags, const std::string& operationId) = 0;
136 
143  virtual BMXErrorCode deleteTags(const std::vector<std::string>& tags, const std::string& operationId) = 0;
144 
150  virtual BMXErrorCode clearTags(const std::string& operationId) = 0;
151 
157  virtual BMXErrorCode setBadge(int count) = 0;
158 
164  virtual BMXErrorCode setPushMode(bool enable = true) = 0;
165 
172  virtual BMXErrorCode setPushTime(int startHour, int endHour) = 0;
173 
180  virtual BMXErrorCode setSilenceTime(int startHour, int endHour) = 0;
181 
187  virtual BMXErrorCode setRunBackgroundMode(bool enable = false) = 0;
188 
195  virtual BMXErrorCode setGeoFenceMode(bool enable = false, bool isAllow = false) = 0;
196 
201  virtual void clearNotification(int64_t notificationId) = 0;
202 
206  virtual void clearAllNotifications() = 0;
207 
212  virtual void sendMessage(const std::string& content) = 0;
213 
221  virtual BMXErrorCode loadLocalPushMessages(int64_t refMsgId, size_t size, BMXMessageList& result, PushDirection = PushDirection::Up) = 0;
222 
227  virtual void addPushListener(BMXPushServiceListener* listener) = 0;
228 
233  virtual void removePushListener(BMXPushServiceListener* listener) = 0;
234 };
235 
236 }
237 
238 #endif /* bmx_push_service_h */
PushSdkStatus
push sdk状态
Definition: bmx_push_service.h:31
Definition: bmx_push_service.h:25
PushDirection
本地推送消息搜索方向
Definition: bmx_push_service.h:45