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
584 , EXIT
585 , GOBACK
586};
587
588
599{
600 NEWS
601 , NOTICE
602 , CUSTOMVIEW
603 , CUSTOMBOARD
604
605};
606
607
616{
617 ENABLED
618
619 , DISABLED
620
621 , UNKNOWN
622
623};
624
631{
633
635 , OFFERWALL_VIEW
636 , USER_ACQUISITION
637 , COUPON
638
640
641 , SOCIAL_INQUIRY_VIEW
642
643 , EVENT
644
645 , IAP_UPDATED
646
647 , IAP_PURCHASE
648 , IAP_PROMOTE
649 , COMPANION
654
655};
656
664{
665 BEGIN
666 , FINISH
667 , EVENT_START
668 , EVENT_END
669};
670
679{
680 EVENT
681 , NOTICE
682 , ALL
683 , CROSS
684};
685
694{
695 GREAT
696 , SMALL
697 , ROLLING
698};
699
700
710class HIVESDK_DLLEXPORT PromotionViewInfo
711{
712public:
713 std::string postString;
714 std::string url;
715
717
718 bool parse(picojson::value jsonParam);
719
720 picojson::object toJson() const;
721
722 std::string toString() const;
723};
724
725
734class HIVESDK_DLLEXPORT PromotionBadgeInfo
735{
736public:
737
744 std::string contentsKey;
745 std::string badgeType;
746
748
749 bool parse(picojson::value jsonParam);
750
751 picojson::object toJson() const;
752
753 std::string toString() const;
754};
755
763class HIVESDK_DLLEXPORT PromotionBannerInfo
764{
765public:
766 int pid;
767 std::string imageUrl;
768 std::string linkUrl;
769 std::string displayStartDate;
770 std::string displayEndDate;
771 long utcStartDate;
772 long utcEndDate;
773 std::string typeLink;
774 std::string typeBanner;
775 std::string typeCampaign;
776
777 std::string interworkData;
778
780
781 bool parse(picojson::value jsonParam);
782
783 picojson::object toJson() const;
784
785 std::string toString() const;
786};
787
788
790// * @brief 보상 지급 요청에 대한 정보 정의<br/>
791// * (showOfferwall() 호출 시, 보상 지급 요청을 보내고 응답을 받은 후, 화면에 wall을 표시해주는 구조임)
792// *
793// * @ingroup Promotion
794// * @author ryuvsken
795// */
796//class HIVESDK_DLLEXPORT OfferwallReward
797//{
798//public:
799// int errorNo;
800// std::string errorMessage;
801// int result;
802// std::string eventID;
803// std::string assetCode;
804// int assetAmount;
805//
806// OfferwallReward();
807//
808// bool parse(picojson::value jsonParam);
809//
810// picojson::object toJson() const;
811//
812// std::string toString() const;
813//};
814
815
827class HIVESDK_DLLEXPORT AppInvitationData
828{
829public:
830 std::vector<char> qrCode;
831 std::string inviteCommonLink;
832 std::string inviteHivemsgLink;
833 std::string inviteFacebookLink;
834 std::vector<AppInvitationCampaign> eachCampaignList;
835 std::vector<AppInvitationCampaignStage> stageCampaignList;
836 std::string inviteMessage;
837
839
840 bool parse(picojson::value jsonParam);
841
842 picojson::object toJson() const;
843
844 std::string toString() const;
845};
846
847
861class HIVESDK_DLLEXPORT AppInvitationCampaign
862{
863public:
864
865 std::string title;
866 std::string description;
867 std::string imageUrl;
868 int order;
869 picojson::value item;
870 int count;
871 int limit;
872 std::string campaignId;
873
875
876 virtual ~AppInvitationCampaign(){}
877 virtual bool parse(picojson::value jsonParam);
878
879 picojson::object toJson() const;
880
881 std::string toString() const;
882};
883
884class HIVESDK_DLLEXPORT AppInvitationCampaignStage: public AppInvitationCampaign
885{
886public:
887 int goalCount;
888 int goalTotal;
889
890 AppInvitationCampaignStage();
891
892 bool parse(picojson::value jsonParam) override;
893};
894
906class HIVESDK_DLLEXPORT AppInvitationSenderInfo
907{
908public:
909 std::string vid;
910
912
913 bool parse(picojson::value jsonParam);
914
915 picojson::object toJson() const;
916
917 std::string toString() const;
918};
919
920NS_HIVE_END // namespace hive
921
922#endif // __HIVE_PROMOTIONVIEW_H__
923
924
Campaign information for invite Campaigns are data that specifies the conditions for rewarding invit...
Definition: HIVE_Promotion.h:862
int count
Number of invitees who completed the campaign.
Definition: HIVE_Promotion.h:870
std::string campaignId
Campaign Id.
Definition: HIVE_Promotion.h:872
int order
Order.
Definition: HIVE_Promotion.h:868
std::string description
Description.
Definition: HIVE_Promotion.h:866
picojson::value item
Complete reward information ("key" depends on campaign settings)
Definition: HIVE_Promotion.h:869
int limit
Maximum number of user of campaigns.
Definition: HIVE_Promotion.h:871
std::string title
Title.
Definition: HIVE_Promotion.h:865
std::string imageUrl
Image URL.
Definition: HIVE_Promotion.h:867
‍**
Definition: HIVE_Promotion.h:828
First sender's userInfo who sent UA share invitation.
Definition: HIVE_Promotion.h:907
Badge information to inform users that new promotions are registered.
Definition: HIVE_Promotion.h:735
PromotionBadgeTarget target
뱃지를 표시해줘야하는 타겟 예를 들어서 NOTICE 이면 공지사항 관련 뱃지를 표시해야한다 (NEWS, NOTICE, CUSTOMVIEW, CUSTOMBOARD 이 올 수 있다....
Definition: HIVE_Promotion.h:743
std::string contentsKey
target 이 커스텀 컨텐츠일 경우 백오피스에 등록된 프로모션 고유 KEY
Definition: HIVE_Promotion.h:744
std::string badgeType
뱃지 종류 ("new" or "none" 이 올 수 있다)
Definition: HIVE_Promotion.h:745
Banner information for a specific promotion.
Definition: HIVE_Promotion.h:764
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:711
Definition: HIVE_ResultAPI.h:64
EngagementEventState
HIVE SDK 가 특정한 조건에서 클라이언트에 개입 (Engagement) 하는 상태
Definition: HIVE_Promotion.h:664
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:631
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:694
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:679
OfferwallState
Information of Offerwall(free charging station) button.
Definition: HIVE_Promotion.h:616
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:599
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.
@ FINISH_PLAYBACK
When Playback is finished.
@ 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.
@ START_PLAYBACK
When Playback starts.
Copyright © Com2uS Platform Corporation. All Right Reserved. Terms of Use Privacy Policy