콘텐츠로 이동

커뮤니티

커뮤니티는 사용자들이 게임 외 공간에서 교류할 수 있는 웹사이트입니다. 커뮤니티는 게임 계정과 무관하게 탈퇴 및 가입이 가능합니다.

커뮤니티 노출하기

Hive SDK는 앱에서 커뮤니티 페이지를 웹뷰로 노출하는 기능을 제공합니다. 커뮤니티 페이지를 노출하려면 다음 과정을 따라야합니다.

  1. 커뮤니티를 노출할 수 있는 버튼 또는 UI 요소를 개발사가 앱에 구현합니다.
  2. 사용자가 앱에서 이 버튼 또는 UI 요소를 선택하면 SocialV4.showCommunity를 호출하도록 Hive SDK 소셜 기능을 활용해 앱을 구현합니다.

커뮤니티 사이트 주소로 withhive.com, com2us.com이 아닌 커스텀 도메인 주소를 사용하려면, 사용할 도메인 주소를 Hive 콘솔 화이트리스트에 등록한 후 SocialV4.showCommunity 메서드를 호출해야합니다.

Warning

Windows 환경에서 개발사가 커뮤니티 페이지를 frame 형태로 직접 제공할 때(=커스텀 도메인 주소 사용), Response Header에 X-Frame-Options를 설정하면 페이지를 렌더링할 수 없습니다. 커뮤니티 페이지를 frame 형태로 열 경우 Response Header에서 X-Frame-Options를 제거하세요.


다음은 커뮤니티 페이지를 노출하는 예제 코드입니다.

API Reference: SocialV4 .showCommunity

using hive;    
    // Set view type (FullScreen: full screen, Frame: frame screen)    
    SocialV4.ViewType viewType = SocialV4.ViewType.Frame;    
    SocialV4.showCommunity(SocialV4.ProviderType.HIVE, viewType, (ResultAPI result) => {    
    if (result.isSuccess()) {    
    // call successful    
    }    
});

API Reference: SocialV4 .showCommunity

#include <HIVE_SDK_Plugin/HIVE_CPP.h>    
    using namespace std;    
    using namespace hive;    
    // Set view type (FullScreen: full screen, Frame: frame screen)    
    SocialV4::ViewType viewType = SocialV4::ViewType::Frame;    
    SocialV4.showCommunity(SocialV4::ProviderType::HIVE, viewType, (ResultAPI const & result) {    
    if (result.isSuccess()) {    
    // call successful    
    }    
});

API Reference: SocialV4.showCommunity

import com.hive.SocialV4;
    import com.hive.ResultAPI;    
    // Set view type (FullScreen: full screen, Frame: frame screen)    
    val viewType = SocialV4.ViewType.Frame    
    SocialV4.showCommunity(SocialV4.ProviderType.HIVE, viewType, object : SocialV4.SocialV4ShowCommunityListener{    
         override fun onShowCommunity(result: ResultAPI) {    
             if (result.isSuccess) {    
                 // call successful    
             }    
         }    
})

API Reference: SocialV4.INSTANCE .showCommunity

import com.hive.SocialV4;    
    import com.hive.ResultAPI;    
    // Set view type (FullScreen: full screen, Frame: frame screen)    
    SocialV4.ViewType viewType = SocialV4.ViewType.Frame;    
    SocialV4.INSTANCE.showCommunity(SocialV4.ProviderType.HIVE, viewType, result -> {    
         if (result.isSuccess()) {    
             // call successful    
         }    
});

API Reference: SocialV4Interface.showCommunity

import HIVEService    
    // Set view type (FullScreen: full screen, Frame: frame screen)    
    let viewType = SocialViewType.Frame    
    SocialV4Interface.showCommunity(.HIVE, viewType) { result in    
    if result.isSuccess() {    
    // call successful    
    }    
}

API Reference: HIVESocialV4 showCommunity

    #import <HIVEService/HIVEService-Swift.h>    
        // Set view type (FullScreen: full screen, Frame: frame screen)    
        HIVESocialViewType viewType = HIVESocialViewTypeFrame;    
        [HIVESocialV4 showCommunity: HVIESocialProviderTypeHIVE viewType: viewType handler: ^(HIVEResultAPI *result) {    
        if ([result isSuccess]) {    
        // call successful    
        }    
}];
#include "HiveSocialV4.h"

// 뷰 타입 설정 (FullScreen: 전체 화면, Frame: 프레임 화면)
ESocialV4ViewType ViewType = ESocialV4ViewType::Frame;

FHiveSocialV4::ShowCommunity(ESocialV4ProviderType::HIVE, ViewType, FHiveSocialV4OnShowCommunityDelegate::CreateLambda([this](const FHiveResultAPI& Result) {

        if (Result.IsSuccess()) {
                // 호출 성공
        }
}));