HIVE SDK for C++

HIVE_Push.h
Go to the documentation of this file.
1
26#ifndef __HIVE_PUSH_H__
27#define __HIVE_PUSH_H__
28
29
30#include "HIVE_ResultAPI.h"
31
32
33NS_HIVE_BEGIN
34
35
36class ResultAPI;
37
38class RemotePush;
39class LocalPush;
40class PushSetting;
41
55class HIVESDK_DLLEXPORT Push
56{
57public:
58
72 typedef std::function<void(ResultAPI const & result, RemotePush const & remotePush)> onRemotePush;
73
74
87 typedef std::function<void(ResultAPI const & result, LocalPush const & localPush)> onLocalPush;
88
89 // MARK: #12076: Foreground Push Handler
103 typedef std::function<void(ResultAPI const &result, PushSetting const &pushSetting)> onPushSetting;
104 // MARK: -
105
117 static void getRemotePush(onRemotePush listener);
118
119
133 static void setRemotePush(RemotePush remotePush, onRemotePush listener);
134
135
148 static void registerLocalPush(LocalPush localPush, onLocalPush listener);
149
150
161 static void unregisterLocalPush(int noticeId);
162
173 static void unregisterLocalPushes(std::vector<int> noticeIDs);
174
184
185 // MARK: #12076: Push Setting
198 static void setForegroundPush(PushSetting setting, onPushSetting listener);
199
211 static void getForegroundPush(onPushSetting listener);
212
222 // MARK: -
223
224
225 // \~korean Native 영역에서 호출된 요청을 처리하기 위한 플러그인 내부 코드
226 // \~english Plug-in internal code to handle requests invoked from the native code.
227 static void executeEngine(picojson::value jsonParam);
228
229};
230
231
232
233
241class HIVESDK_DLLEXPORT RemotePush {
242
243public:
244
246
248
249
250 RemotePush();
251
252 RemotePush(bool isAgreeNotice, bool isAgreeNight);
253
254 RemotePush(picojson::value jsonParam);
255
256 picojson::object toJson() const;
257
258 std::string toString() const;
259};
260
261
269class HIVESDK_DLLEXPORT LocalPush
270{
271public:
272
274
275 std::string title;
276
277 std::string msg;
278
279 long after;
280
281 std::string groupId;
282
283
284 // \~korean 이하 Android에서 로컬 푸시를 커스터마이징하기 위한 필드 정의
285 // \~english Followings are field definition for customizing local push on Android.
286
287 std::string bigmsg;
288
289 std::string ticker;
290
291 std::string type;
292
293 std::string icon;
294
295 std::string sound;
296
297 std::string active;
298
299 std::string broadcastAction;
300 int buckettype;
301 int bucketsize;
302 std::string bigpicture;
303 std::string icon_color;
304
305
306 LocalPush();
307
308 LocalPush(int noticeID, std::string title, std::string msg, long after);
309
310 LocalPush(picojson::value jsonParam);
311
312 picojson::object toJson() const;
313
314 std::string toString() const;
315};
316
317// MARK: #12076 Push Setting
325class HIVESDK_DLLEXPORT PushSetting
326{
327public:
328
331
332 PushSetting();
333
334 PushSetting(bool useForegroundRemotePush, bool useForegroundLocalPush);
335
336 PushSetting(picojson::value jsonParam);
337
338 picojson::object toJson() const;
339
340 std::string toString() const;
341};
342// MARK: -
343
344
345NS_HIVE_END // namespace hive
346
347
348#endif // __HIVE_PUSH_H__
349
350
Local push registration information.
Definition: HIVE_Push.h:270
long after
Notification timer.
Definition: HIVE_Push.h:279
std::string icon
Push icon.
Definition: HIVE_Push.h:293
std::string title
Local push title.
Definition: HIVE_Push.h:275
std::string active
Action to take.
Definition: HIVE_Push.h:297
std::string ticker
Message Ticker.
Definition: HIVE_Push.h:289
std::string sound
Notification sound.
Definition: HIVE_Push.h:295
std::string msg
Local push message.
Definition: HIVE_Push.h:277
std::string groupId
Notification Group ID.
Definition: HIVE_Push.h:281
int noticeId
Local push notification ID.
Definition: HIVE_Push.h:273
std::string type
Notification type (bar, popup, toast etc.)
Definition: HIVE_Push.h:291
std::string bigmsg
Big-text.
Definition: HIVE_Push.h:287
In mobile games, push notification service provides an important method to increase the retention of ...
Definition: HIVE_Push.h:56
Push setting information.
Definition: HIVE_Push.h:326
bool useForegroundLocalPush
Whether to enable local notification on the activated app.
Definition: HIVE_Push.h:330
bool useForegroundRemotePush
Whether to enable remote notification or not on the activated app.
Definition: HIVE_Push.h:329
Information about the status of receiving push notification.
Definition: HIVE_Push.h:241
bool isAgreeNotice
Whether to receive announcement notification or not.
Definition: HIVE_Push.h:245
bool isAgreeNight
Whether to receive night-time notification or not.
Definition: HIVE_Push.h:247
Definition: HIVE_ResultAPI.h:63
static void setRemotePush(RemotePush remotePush, onRemotePush listener)
Set the status of receiving push notification.
std::function< void(ResultAPI const &result, PushSetting const &pushSetting)> onPushSetting
Returns the result of push settings on the activated app.
Definition: HIVE_Push.h:103
static void getRemotePush(onRemotePush listener)
Request the status of receiving push notification.
static void unregisterLocalPushes(std::vector< int > noticeIDs)
Unregister Local push notification.
static void unregisterLocalPush(int noticeId)
Unregister Local push notification.
static void unregisterAllLocalPushes()
Unregister All local pushes including Hive local pushes.
std::function< void(ResultAPI const &result, RemotePush const &remotePush)> onRemotePush
Returns information of receiving the remote push.
Definition: HIVE_Push.h:72
std::function< void(ResultAPI const &result, LocalPush const &localPush)> onLocalPush
Returns information of receiving the local push.
Definition: HIVE_Push.h:87
static void requestPushPermission()
Request Push Token.
static void registerLocalPush(LocalPush localPush, onLocalPush listener)
Register Local push notification.
static void getForegroundPush(onPushSetting listener)
Get the value whether to enable push notification or not on the activated app.
static void setForegroundPush(PushSetting setting, onPushSetting listener)
Set the value whether to enable push notification or not on the activated app.
Copyright © Com2uS Platform Corporation. All Right Reserved. Terms of Use Privacy Policy