Hi everyone~!
I have some problem.
First, My Environment is…
Windows7
cocos2d-x 3.17.2
Android Studio
sdkbox
cpp
…and build type is "cmake"
My problem is sdkbox::PluginGPG::gpg() result is null.
Work process is…
make cocos2d-x 3.17.2 cpp project with command line
build setup with sonar system tutorial
build test : success
sdkbox setup with GUI 1.17
edit CMakeLists.txt
6. build test : success
Build succeeded.
But crashed when call sdkbox::PluginGPG::gpg()->IsAuthorized().
So i checked gpg.
gpg is null.
How can i init gpg( Game Services )?
CMakeLists.zip (2.1 KB)
HyunminRyu:
PluginGPG
Are you sure, you did call sdkbox::PluginGPG::init(); before call any other PluginGPG methods?
Yes~!
bool AppDelegate::applicationDidFinishLaunching()
{
#ifdef SDKBOX_ENABLED
sdkbox::PluginGPG::init();
#endif
// initialize director
auto director = Director::getInstance();
This code is added by sdkbox gui.
there is a example show how to use PluginGPG
_txtConnection->setPosition(cocos2d::Point(size.width - 200, 65));
addChild(_txtConnection);
initGPG();
return true;
}
void BaseScene::initGPG()
{
StateManager::setCallback([this](gpg::AuthOperation op, gpg::AuthStatus st){
updateConnectionStatus();
});
StateManager::Init(*CreatePlatformConfiguration().get());
_game_services = StateManager::GetGameServices();
if(!StateManager::IsSignedIn())
{
StateManager::SignIn();
}
Is this correct?
if I manage gameservices. i don’t have to use sdkbox.
Is there a way to make the return value of this function not null?
class PluginGPG
{
...
static GameServices* gpg();
};