HIVE SDK for C++

HIVE_Promotion.h
Go to the documentation of this file.
1
21#ifndef __HIVE_PROMOTIONVIEW_H__
22#define __HIVE_PROMOTIONVIEW_H__
23
24
25#include "HIVE_ResultAPI.h"
26#include <vector>
27
28NS_HIVE_BEGIN
29
30
31class ResultAPI;
32
33enum class PromotionType;
34enum class PromotionCustomType;
35enum class PromotionEventType;
36enum class PromotionBadgeTarget;
37enum class PromotionCampaignType;
38enum class PromotionBannerType;
39enum class OfferwallState;
40enum class EngagementEventType;
41enum class EngagementEventState;
42
46//class OfferwallReward;
49class AppInvitationCampaignStage;
51
52
65class HIVESDK_DLLEXPORT Promotion {
66
67public:
68
82 typedef std::function<void(ResultAPI const & result, PromotionEventType promotionEventType)> onPromotionView;
83
84
97 typedef std::function<void(ResultAPI const & result, std::vector<PromotionViewInfo> const & promotionViewInfo)> onPromotionViewInfo;
98
99
112 typedef std::function<void(ResultAPI const & result, std::vector<PromotionBadgeInfo> const & badgeInfoList)> onPromotionBadgeInfo;
113
114
127 typedef std::function<void(ResultAPI const & result, std::vector<PromotionBannerInfo> const & bannerInfoList)> onPromotionBannerInfo;
128
129
142 typedef std::function<void(ResultAPI const & result, AppInvitationData const & appInvitationData)> onAppInvitationData;
143
163 typedef std::function<void(ResultAPI const & result, EngagementEventType engagementEventType, EngagementEventState engagementEventState, picojson::value const & param)> onEngagement;
164 typedef std::function<void(ResultAPI const& result, EngagementEventType engagementEventType, EngagementEventState engagementEventState, std::string const& param)> onEngagementString;
165
174 typedef std::function<void(ResultAPI const & result)> onPromotionUAShare;
175
188 typedef std::function<void(ResultAPI const & result, AppInvitationSenderInfo const & senderInfo)> onAppInvitationSenderInfo;
189
190
215 static void showPromotion(PromotionType promotionType, bool isForced, onPromotionView listener);
216
217
231 static void showCustomContents(PromotionCustomType customType, std::string contentsKey, onPromotionView listener);
232
247 static void showCustomContentsOnGameWindow(PromotionCustomType customType, std::string contentsKey, onPromotionView listener);
248
262
263
278 static void showOfferwall(onPromotionView listener);
279
291 static void showNews(std::string menu, std::vector<int> giftPidList, onPromotionView listener);
292
308 static void showNativeReview(onPromotionView listener);
309
324 static void showReview(onPromotionView listener);
325
326
339 static void showExit(onPromotionView listener);
340
341
353 static void getViewInfo(PromotionCustomType customType, std::string contentsKey, onPromotionViewInfo listener);
354
355
368 static void getBadgeInfo(onPromotionBadgeInfo listener);
369
370
386 static void getBannerInfo(PromotionCampaignType campaignType, PromotionBannerType bannerType, onPromotionBannerInfo listener);
387
388
404 static void getBannerInfoString(std::string campaignString, std::string bannerString, onPromotionBannerInfo listener);
405
406
427
428
445 static void setAdditionalInfo(std::string additionalInfo);
446
447
464 static ResultAPI setEngagementReady(bool isReady);
465
466
479 static bool processURI(std::string URI);
480
488 static void setEngagementHandler(onEngagement engagementHandler);
489
503 static void showUAShare(std::string inviteMessage, std::string inviteLink, onPromotionUAShare uaShareHandler);
504
512 static void updatePromotionData();
513
525 static void getAppInvitationSenderInfo(onAppInvitationSenderInfo appInvitationSenderInfoHandler);
526
527 // Native 영역에서 호출된 요청을 처리하기 위한 플러그인 내부 코드
528 static void executeEngine(picojson::value jsonParam);
529
530};
531
532
533
543{
544 BANNERLegacy = -1
545 , BANNER
546 , NEWS
547 , NOTICE
548
549};
550
551
561{
562 VIEW
563 , BOARD
564 , SPOT
565 , DIRECT
566
567};
568
569
579{
580 OPEN
581 , CLOSE
582 , EXIT
583 , GOBACK
584};
585
586
597{
598 NEWS
599 , NOTICE
600 , CUSTOMVIEW
601 , CUSTOMBOARD
602
603};
604
605
614{
615 ENABLED
616
617 , DISABLED
618
619 , UNKNOWN
620
621};
622
629{
631
633 , OFFERWALL_VIEW
634 , USER_ACQUISITION
635 , COUPON
636
638
639 , SOCIAL_INQUIRY_VIEW
640
641 , EVENT
642
643 , IAP_UPDATED
644
645 , IAP_PURCHASE
646 , IAP_PROMOTE
647 , COMPANION
652
653};
654
662{
663 BEGIN
664 , FINISH
665 , EVENT_START
666 , EVENT_END
667};
668
677{
678 EVENT
679 , NOTICE
680 , ALL
681 , CROSS
682};
683
692{
693 GREAT
694 , SMALL
695 , ROLLING
696};
697
698
708class HIVESDK_DLLEXPORT PromotionViewInfo
709{
710public:
711 std::string postString;
712 std::string url;
713
715
716 bool parse(picojson::value jsonParam);
717
718 picojson::object toJson() const;
719
720 std::string toString() const;
721};
722
723
732class HIVESDK_DLLEXPORT PromotionBadgeInfo
733{
734public:
735
742 std::string contentsKey;
743 std::string badgeType;
744
746
747 bool parse(picojson::value jsonParam);
748
749 picojson::object toJson() const;
750
751 std::string toString() const;
752};
753
761class HIVESDK_DLLEXPORT PromotionBannerInfo
762{
763public:
764 int pid;
765 std::string imageUrl;
766 std::string linkUrl;
767 std::string displayStartDate;
768 std::string displayEndDate;
769 long utcStartDate;
770 long utcEndDate;
771 std::string typeLink;
772 std::string typeBanner;
773 std::string typeCampaign;
774
775 std::string interworkData;
776
778
779 bool parse(picojson::value jsonParam);
780
781 picojson::object toJson() const;
782
783 std::string toString() const;
784};
785
786
788// * @brief 보상 지급 요청에 대한 정보 정의<br/>
789// * (showOfferwall() 호출 시, 보상 지급 요청을 보내고 응답을 받은 후, 화면에 wall을 표시해주는 구조임)
790// *
791// * @ingroup Promotion
792// * @author ryuvsken
793// */
794//class HIVESDK_DLLEXPORT OfferwallReward
795//{
796//public:
797// int errorNo;
798// std::string errorMessage;
799// int result;
800// std::string eventID;
801// std::string assetCode;
802// int assetAmount;
803//
804// OfferwallReward();
805//
806// bool parse(picojson::value jsonParam);
807//
808// picojson::object toJson() const;
809//
810// std::string toString() const;
811//};
812
813
825class HIVESDK_DLLEXPORT AppInvitationData
826{
827public:
828 std::vector<char> qrCode;
829 std::string inviteCommonLink;
830 std::string inviteHivemsgLink;
831 std::string inviteFacebookLink;
832 std::vector<AppInvitationCampaign> eachCampaignList;
833 std::vector<AppInvitationCampaignStage> stageCampaignList;
834 std::string inviteMessage;
835
837
838 bool parse(picojson::value jsonParam);
839
840 picojson::object toJson() const;
841
842 std::string toString() const;
843};
844
845
859class HIVESDK_DLLEXPORT AppInvitationCampaign
860{
861public:
862
863 std::string title;
864 std::string description;
865 std::string imageUrl;
866 int order;
867 picojson::value item;
868 int count;
869 int limit;
870 std::string campaignId;
871
873
874 virtual ~AppInvitationCampaign(){}
875 virtual bool parse(picojson::value jsonParam);
876
877 picojson::object toJson() const;
878
879 std::string toString() const;
880};
881
882class HIVESDK_DLLEXPORT AppInvitationCampaignStage: public AppInvitationCampaign
883{
884public:
885 int goalCount;
886 int goalTotal;
887
888 AppInvitationCampaignStage();
889
890 bool parse(picojson::value jsonParam) override;
891};
892
904class HIVESDK_DLLEXPORT AppInvitationSenderInfo
905{
906public:
907 std::string vid;
908
910
911 bool parse(picojson::value jsonParam);
912
913 picojson::object toJson() const;
914
915 std::string toString() const;
916};
917
918NS_HIVE_END // namespace hive
919
920#endif // __HIVE_PROMOTIONVIEW_H__
921
922
Campaign information for invite Campaigns are data that specifies the conditions for rewarding invit...
Definition: HIVE_Promotion.h:860
int count
Number of invitees who completed the campaign.
Definition: HIVE_Promotion.h:868
std::string campaignId
Campaign Id.
Definition: HIVE_Promotion.h:870
int order
Order.
Definition: HIVE_Promotion.h:866
std::string description
Description.
Definition: HIVE_Promotion.h:864
picojson::value item
Complete reward information ("key" depends on campaign settings)
Definition: HIVE_Promotion.h:867
int limit
Maximum number of user of campaigns.
Definition: HIVE_Promotion.h:869
std::string title
Title.
Definition: HIVE_Promotion.h:863
std::string imageUrl
Image URL.
Definition: HIVE_Promotion.h:865
‍**
Definition: HIVE_Promotion.h:826
First sender's userInfo who sent UA share invitation.
Definition: HIVE_Promotion.h:905
Badge information to inform users that new promotions are registered.
Definition: HIVE_Promotion.h:733
PromotionBadgeTarget target
뱃지를 표시해줘야하는 타겟 예를 들어서 NOTICE 이면 공지사항 관련 뱃지를 표시해야한다 (NEWS, NOTICE, CUSTOMVIEW, CUSTOMBOARD 이 올 수 있다....
Definition: HIVE_Promotion.h:741
std::string contentsKey
target 이 커스텀 컨텐츠일 경우 백오피스에 등록된 프로모션 고유 KEY
Definition: HIVE_Promotion.h:742
std::string badgeType
뱃지 종류 ("new" or "none" 이 올 수 있다)
Definition: HIVE_Promotion.h:743
Banner information for a specific promotion.
Definition: HIVE_Promotion.h:762
HIVE Promotion provides you with the ability to effectively expose new news or events to the game use...
Definition: HIVE_Promotion.h:65
static void updatePromotionData()
Update information of Promotion Update promotion data to show Promotion UI.
std::function< void(ResultAPI const &result)> onPromotionUAShare
Returns HIVE UA Share information.
Definition: HIVE_Promotion.h:174
Information of Promotion webview (Information to customize your promotion Webview UI)
Definition: HIVE_Promotion.h:709
Definition: HIVE_ResultAPI.h:64
EngagementEventState
HIVE SDK 가 특정한 조건에서 클라이언트에 개입 (Engagement) 하는 상태
Definition: HIVE_Promotion.h:662
static void setAdditionalInfo(std::string additionalInfo)
You can set a string in JSON format when you want to expose a specific event page in the Promotion Vi...
static void getAppInvitationData(onAppInvitationData listener)
Request user invite information User acquisition information is provided to attract more users in th...
static OfferwallState getOfferwallState()
Returns whether the button is available to invoke an offerwall (free recharging station) within the g...
EngagementEventType
UserEngagement 기능 타입
Definition: HIVE_Promotion.h:629
static void showPromotion(PromotionType promotionType, bool isForced, onPromotionView listener)
Shows banner such as new event of game or introduce new game.
static void showReview(onPromotionView listener)
Show review popup Positive ratings and reviews of game users will affect other users' use of the ga...
std::function< void(ResultAPI const &result, std::vector< PromotionViewInfo > const &promotionViewInfo)> onPromotionViewInfo
Returns HIVE Promotion Webview information so that your UI of webview is configured according to the ...
Definition: HIVE_Promotion.h:97
PromotionBannerType
Banner type selected before requesting rolling banner data.
Definition: HIVE_Promotion.h:692
PromotionCustomType
Types of Promotion CustomView.
Definition: HIVE_Promotion.h:561
std::function< void(ResultAPI const &result, PromotionEventType promotionEventType)> onPromotionView
Promotion View API Result.
Definition: HIVE_Promotion.h:82
static void getBannerInfo(PromotionCampaignType campaignType, PromotionBannerType bannerType, onPromotionBannerInfo listener)
Request banner information Request banner information for a specific promotion.
PromotionCampaignType
Campaign type selected before requesting rolling banner data.
Definition: HIVE_Promotion.h:677
OfferwallState
Information of Offerwall(free charging station) button.
Definition: HIVE_Promotion.h:614
static void showNativeReview(onPromotionView listener)
Show review popup Positive ratings and reviews of game users will affect other users' use of the ga...
static void showUAShare(std::string inviteMessage, std::string inviteLink, onPromotionUAShare uaShareHandler)
Show dialog to share UA url via SNS.
static void showCustomContentsOnGameWindow(PromotionCustomType customType, std::string contentsKey, onPromotionView listener)
Show custom Webview to use external content.
std::function< void(ResultAPI const &result, AppInvitationSenderInfo const &senderInfo)> onAppInvitationSenderInfo
First sender's userInfo who sent UA share invitation.
Definition: HIVE_Promotion.h:188
std::function< void(ResultAPI const &result, std::vector< PromotionBannerInfo > const &bannerInfoList)> onPromotionBannerInfo
HIVE Promotion banner information.
Definition: HIVE_Promotion.h:127
static void getAppInvitationSenderInfo(onAppInvitationSenderInfo appInvitationSenderInfoHandler)
return first sender's userInfo who sent UA share invitation First sender's information can be returne...
static void getBannerInfoString(std::string campaignString, std::string bannerString, onPromotionBannerInfo listener)
Request banner information Request banner information for a specific promotion.
static bool processURI(std::string URI)
Parse the URI to make it an Event type.
PromotionType
Types of Promotion view.
Definition: HIVE_Promotion.h:543
static void showExit(onPromotionView listener)
Show exit popup (Android only) Expose exit popup which include a button called "More games" to lead ...
std::function< void(ResultAPI const &result, AppInvitationData const &appInvitationData)> onAppInvitationData
Return information about request for user invite (UserAcquisition)
Definition: HIVE_Promotion.h:142
static void showCustomContents(PromotionCustomType customType, std::string contentsKey, onPromotionView listener)
Show custom Webview to use external content.
static void getBadgeInfo(onPromotionBadgeInfo listener)
Request badge information The promotional badge is information that highlights the button UI of the ...
static void showNews(std::string menu, std::vector< int > giftPidList, onPromotionView listener)
Shows banner such as new event of game or introduce new game.
static void showOfferwall(onPromotionView listener)
Show Offerwall(Free recharging station) (Android only.) The Offerwall (free recharge station) is an ...
std::function< void(ResultAPI const &result, std::vector< PromotionBadgeInfo > const &badgeInfoList)> onPromotionBadgeInfo
Returns HIVE Promotion badge information.
Definition: HIVE_Promotion.h:112
static ResultAPI setEngagementReady(bool isReady)
It sets whether Engagement event handling is enabled.
PromotionEventType
Promotion view event types.
Definition: HIVE_Promotion.h:579
static void getViewInfo(PromotionCustomType customType, std::string contentsKey, onPromotionViewInfo listener)
Request HIVE Promotion Webview information so that your UI of webview is configured according to the ...
PromotionBadgeTarget
Information on which promotional badge is displayed If NOTICE, it should indicate the badge related ...
Definition: HIVE_Promotion.h:597
std::function< void(ResultAPI const &result, EngagementEventType engagementEventType, EngagementEventState engagementEventState, picojson::value const &param)> onEngagement
An event listener for the SDK to engage clients in certain conditions.
Definition: HIVE_Promotion.h:163
static void setEngagementHandler(onEngagement engagementHandler)
It register the Engagement listener.
@ BEGIN
Engagement에 의해 최초 기능이 수행되기 시작함을 알림.
@ EVENT_START
Engagement에 의해 특정 기능이 수행되기 시작함을 알림.
@ FINISH
Engagement에 의한 모든 기능 수행이 종료됨을 알림.
@ EVENT_END
Engagement에 의한 특정 기능 수행이 종료됨을 알림.
@ EVENT
kHIVEEngagementEventTypeEvent Engagement에 의해 처리될 수 없는 이벤트(host가 game인 경우)를 전달해주는 콜백.
@ SOCIAL_PROFILE_VIEW
프로필 페이지 오픈
@ IAP_UPDATED
Deprecated in HIVE SDK 4.5.0.
@ COUPON
kHIVEEngagementEventTypeCoupon Engagement에 의해 처리된 쿠폰 소모에 대한 결과. EventState가 kHIVEEngagementStateEvent...
@ SOCIAL_MYINQUIRY_VIEW
내 문의 내역을 오픈
@ IAP_PROMOTE
kHIVEEngagementEventTypeIapPromote 앱이 시작 혹은 실행 중일 때, 앱 외에서 상품을 구매시도시 불리게 되는 콜백. 해당 콜백이 불리면 게임에서는 아이템...
@ APPUPDATE_DOWNLOADED
In-App Update Downloaded.
@ EVENT_TYPE
< kHIVEEngagementEventType Engagement의 전체 시작과 끝을 알리는 경우. (이름 변경 예정)
@ PROMOTION_VIEW
kHIVEEngagementEventTypePromotionView Engagement에 의해 처리되는 PromotionView인 경우. EventState가 kHIVEEngagem...
@ AUTH_LOGIN_VIEW
kHIVEEngagementEventTypeAuthLogin 유저(클라이언트)에 의해 열리지 않은 로그인 프로세스에 의한 결과를 받는 콜백.
@ COMPANION
Promotion CPA Link received. SDK Will be send promotion companion.
@ COMMUNITY_VIEW
커뮤니티 페이지를 오픈. Open the community page.
@ IAP_PURCHASE
kHIVEEngagementEventTypeIapPurchase 앱이 시작 혹은 실행 중일 때, 앱 외에서 상품을 구매시도시 불리게 되는 콜백. 해당 콜백이 불리면 구매 팝업이 노...
@ DIRECT
Direct campaign.
@ VIEW
Custom view.
@ SPOT
Spot banner.
@ BOARD
Custom board.
@ DISABLED
Offerwall Button cannot be exposed.
@ UNKNOWN
Unknown status whether available to expose buttons or not.
@ ENABLED
Offerwall Button can be exposed.
@ BANNER
Full banner.
@ BANNERLegacy
Full Banner.
@ NOTICE
Notice.
@ CLOSE
When the Promotion View window is closed.
@ OPEN
When the Promotion View window opens.
@ EXIT
When you choose to quit from the Quit (see more games) popup.
Copyright © Com2uS Platform Corporation. All Right Reserved. Terms of Use Privacy Policy