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
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 // Unreal CrossPlay Version
490 static void setEngagementHandler(onEngagementString engagementHandler);
491
492
493
507 static void showUAShare(std::string inviteMessage, std::string inviteLink, onPromotionUAShare uaShareHandler);
508
516 static void updatePromotionData();
517
529 static void getAppInvitationSenderInfo(onAppInvitationSenderInfo appInvitationSenderInfoHandler);
530
531 // Native 영역에서 호출된 요청을 처리하기 위한 플러그인 내부 코드
532 static void executeEngine(picojson::value jsonParam);
533
534};
535
536
537
547{
548 BANNERLegacy = -1
549 , BANNER
550 , NEWS
551 , NOTICE
552
553};
554
555
565{
566 VIEW
567 , BOARD
568 , SPOT
569 , DIRECT
570
571};
572
573
583{
584 OPEN
585 , CLOSE
588 , EXIT
589 , GOBACK
590};
591
592
603{
604 NEWS
605 , NOTICE
606 , CUSTOMVIEW
607 , CUSTOMBOARD
608
609};
610
611
620{
621 ENABLED
622
623 , DISABLED
624
625 , UNKNOWN
626
627};
628
635{
637
639 , OFFERWALL_VIEW
640 , USER_ACQUISITION
641 , COUPON
642
644
645 , SOCIAL_INQUIRY_VIEW
646
647 , EVENT
648
649 , IAP_UPDATED
650
651 , IAP_PURCHASE
652 , IAP_PROMOTE
653 , COMPANION
657
658};
659
667{
668 BEGIN
669 , FINISH
670 , EVENT_START
671 , EVENT_END
672};
673
682{
683 EVENT
684 , NOTICE
685 , ALL
686 , CROSS
687};
688
697{
698 GREAT
699 , SMALL
700 , ROLLING
701};
702
703
713class HIVESDK_DLLEXPORT PromotionViewInfo
714{
715public:
716 std::string postString;
717 std::string url;
718
720
721 bool parse(picojson::value jsonParam);
722
723 picojson::object toJson() const;
724
725 std::string toString() const;
726};
727
728
737class HIVESDK_DLLEXPORT PromotionBadgeInfo
738{
739public:
740
747 std::string contentsKey;
748 std::string badgeType;
749
751
752 bool parse(picojson::value jsonParam);
753
754 picojson::object toJson() const;
755
756 std::string toString() const;
757};
758
766class HIVESDK_DLLEXPORT PromotionBannerInfo
767{
768public:
769 int pid;
770 std::string imageUrl;
771 std::string linkUrl;
772 std::string displayStartDate;
773 std::string displayEndDate;
774 long utcStartDate;
775 long utcEndDate;
776 std::string typeLink;
777 std::string typeBanner;
778 std::string typeCampaign;
779
780 std::string interworkData;
781
783
784 bool parse(picojson::value jsonParam);
785
786 picojson::object toJson() const;
787
788 std::string toString() const;
789};
790
791
793// * @brief 보상 지급 요청에 대한 정보 정의<br/>
794// * (showOfferwall() 호출 시, 보상 지급 요청을 보내고 응답을 받은 후, 화면에 wall을 표시해주는 구조임)
795// *
796// * @ingroup Promotion
797// * @author ryuvsken
798// */
799//class HIVESDK_DLLEXPORT OfferwallReward
800//{
801//public:
802// int errorNo;
803// std::string errorMessage;
804// int result;
805// std::string eventID;
806// std::string assetCode;
807// int assetAmount;
808//
809// OfferwallReward();
810//
811// bool parse(picojson::value jsonParam);
812//
813// picojson::object toJson() const;
814//
815// std::string toString() const;
816//};
817
818
830class HIVESDK_DLLEXPORT AppInvitationData
831{
832public:
833 std::vector<char> qrCode;
834 std::string inviteCommonLink;
835 std::string inviteHivemsgLink;
836 std::string inviteFacebookLink;
837 std::vector<AppInvitationCampaign> eachCampaignList;
838 std::vector<AppInvitationCampaignStage> stageCampaignList;
839 std::string inviteMessage;
840
842
843 bool parse(picojson::value jsonParam);
844
845 picojson::object toJson() const;
846
847 std::string toString() const;
848};
849
850
864class HIVESDK_DLLEXPORT AppInvitationCampaign
865{
866public:
867
868 std::string title;
869 std::string description;
870 std::string imageUrl;
871 int order;
872 picojson::value item;
873 std::string itemJsonString;
874 int count;
875 int limit;
876
878
879 virtual ~AppInvitationCampaign(){}
880 virtual bool parse(picojson::value jsonParam);
881
882 picojson::object toJson() const;
883
884 std::string toString() const;
885};
886
887class HIVESDK_DLLEXPORT AppInvitationCampaignStage: public AppInvitationCampaign
888{
889public:
890 int goalCount;
891 int goalTotal;
892
893 AppInvitationCampaignStage();
894
895 bool parse(picojson::value jsonParam) override;
896};
897
909class HIVESDK_DLLEXPORT AppInvitationSenderInfo
910{
911public:
912 std::string vid;
913
915
916 bool parse(picojson::value jsonParam);
917
918 picojson::object toJson() const;
919
920 std::string toString() const;
921};
922
923NS_HIVE_END // namespace hive
924
925// C-Style
926extern "C"
927{
928 HIVESDK_DLLEXPORT const char* PromotionSetEngagementReady(bool isReady);
929 HIVESDK_DLLEXPORT bool PromotionHIVEProcessURI(const char* URI);
930}
931
932
933#endif // __HIVE_PROMOTIONVIEW_H__
934
935
Campaign information for invite Campaigns are data that specifies the conditions for rewarding invit...
Definition: HIVE_Promotion.h:865
int count
Number of invitees who completed the campaign.
Definition: HIVE_Promotion.h:874
int order
Order.
Definition: HIVE_Promotion.h:871
std::string description
Description.
Definition: HIVE_Promotion.h:869
picojson::value item
Complete reward information ("key" depends on campaign settings)
Definition: HIVE_Promotion.h:872
int limit
Maximum number of user of campaigns.
Definition: HIVE_Promotion.h:875
std::string itemJsonString
Complete reward information ("key" depends on campaign settings) Unreal CrossPlay.
Definition: HIVE_Promotion.h:873
std::string title
Title.
Definition: HIVE_Promotion.h:868
std::string imageUrl
Image URL.
Definition: HIVE_Promotion.h:870
‍**
Definition: HIVE_Promotion.h:831
First sender's userInfo who sent UA share invitation.
Definition: HIVE_Promotion.h:910
Badge information to inform users that new promotions are registered.
Definition: HIVE_Promotion.h:738
PromotionBadgeTarget target
뱃지를 표시해줘야하는 타겟 예를 들어서 NOTICE 이면 공지사항 관련 뱃지를 표시해야한다 (NEWS, NOTICE, CUSTOMVIEW, CUSTOMBOARD 이 올 수 있다....
Definition: HIVE_Promotion.h:746
std::string contentsKey
target 이 커스텀 컨텐츠일 경우 백오피스에 등록된 프로모션 고유 KEY
Definition: HIVE_Promotion.h:747
std::string badgeType
뱃지 종류 ("new" or "none" 이 올 수 있다)
Definition: HIVE_Promotion.h:748
Banner information for a specific promotion.
Definition: HIVE_Promotion.h:767
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()
/~korean Promotion 정보 갱신 Promotion 새소식 페이지 등의 노출에 필요한 정보를 갱신한다.
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:714
Definition: HIVE_ResultAPI.h:63
EngagementEventState
HIVE SDK 가 특정한 조건에서 클라이언트에 개입 (Engagement) 하는 상태
Definition: HIVE_Promotion.h:667
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:635
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:697
PromotionCustomType
Types of Promotion CustomView.
Definition: HIVE_Promotion.h:565
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:682
OfferwallState
Information of Offerwall(free charging station) button.
Definition: HIVE_Promotion.h:620
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:547
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:583
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:603
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 앱이 시작 혹은 실행 중일 때, 앱 외에서 상품을 구매시도시 불리게 되는 콜백. 해당 콜백이 불리면 게임에서는 아이템...
@ EVENT_TYPE
< kHIVEEngagementEventType Engagement의 전체 시작과 끝을 알리는 경우. (이름 변경 예정)
@ PROMOTION_VIEW
kHIVEEngagementEventTypePromotionView Engagement에 의해 처리되는 PromotionView인 경우. EventState가 kHIVEEngagem...
@ AUTH_LOGIN_VIEW
kHIVEEngagementEventTypeAuthLogin 유저(클라이언트)에 의해 열리지 않은 로그인 프로세스에 의한 결과를 받는 콜백.
@ COMPANION
Promotion CPA Link recevied. 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