Skip to content

Community

Community is a website where users can interact outside of the game. The community allows for withdrawal and membership regardless of the game account.

Exposing the community

Hive SDK provides the functionality to display the community page in a web view within the app. To display the community page, you must follow the steps below.

  1. The developer implements a button or UI element that can expose the community in the app.
  2. When the user selects this button or UI element in the app, the app utilizes the Hive SDK social feature to call SocialV4.showCommunity.

To use a custom domain address instead of withhive.com or com2us.com for the community site address, you must register the domain address in the Hive console whitelist and then call the SocialV4.showCommunity method.

Warning

When a developer provides the community page in a frame format in a Windows environment (=using a custom domain address), setting X-Frame-Options in the Response Header will prevent the page from rendering. If you open the community page in a frame format, please remove X-Frame-Options from the Response Header.


This is an example code that exposes the community page.

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"

// View type setting (FullScreen: full screen, Frame: frame screen)
ESocialV4ViewType ViewType = ESocialV4ViewType::Frame;

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

        if (Result.IsSuccess()) {
                // Call successful
        }
}));