My first question is this: why does the link point to the js docs when my project is cpp? Is this just the default landing page?
After following the notices on the cpp page, the build fails in several header files that try to include ‘jsapi.h’ because the file can’t be found.
How can I fix this?
Interestingly, I did have to add the res folder so that it could copy the sdkbox_config.json into it. I was also prompted by xcode to link to storekit and enable in-app purchases, but I didn’t see that documented online. Please advise if this is normal.
Interesting, so sdkbox mistakenly identify your project as cocos-js project…
Can you share your AppDelegate.cpp file? I think you just need to remove the js related functions.
#include "AppDelegate.h"
#include "MenuScene.h"
USING_NS_CC;
AppDelegate::AppDelegate() {
}
AppDelegate::~AppDelegate()
{
}
//if you want a different context,just modify the value of glContextAttrs
//it will takes effect on all platforms
void AppDelegate::initGLContextAttrs()
{
//set OpenGL context attributions,now can only set six attributions:
//red,green,blue,alpha,depth,stencil
GLContextAttrs glContextAttrs = {8, 8, 8, 8, 24, 8};
GLView::setGLContextAttrs(glContextAttrs);
}
// If you want to use packages manager to install more packages,
// don't modify or remove this function
static int register_all_packages()
{
return 0; //flag for packages manager
}
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
glview = GLViewImpl::createWithRect("totToDot", Rect(0, 0, designResolutionSize.width, designResolutionSize.height));
#else
glview = GLViewImpl::create("totToDot");
#endif
director->setOpenGLView(glview);
}
// turn on display FPS
director->setDisplayStats(false);
// set FPS. the default value is 1.0/60 if you don't call this
director->setAnimationInterval(1.0 / 60);
register_all_packages();
// create a scene. it's an autorelease object
auto scene = MenuScene::createScene();
// run
director->runWithScene(scene);
return true;
}
// This function will be called when the app is inactive. When comes a phone call,it's be invoked too
void AppDelegate::applicationDidEnterBackground() {
Director::getInstance()->stopAnimation();
// if you use SimpleAudioEngine, it must be pause
// SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
}
// this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground() {
Director::getInstance()->startAnimation();
// if you use SimpleAudioEngine, it must resume here
// SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
}
In file included from .../Classes/PluginIAPJS.cpp:1:
.../Classes/PluginIAPJS.hpp:4:10: fatal error: 'jsapi.h' file not found
#include "jsapi.h"
^
1 error generated.
These files were added to the project:
PluginIAPJS.cpp
PluginIAPJS.hpp
PluginIAPJSHelper.cpp
PluginIAPJSHelper.h
SDKBoxJSHelper.cpp
SDKBoxJSHelper.h
Are these the right files to add for a cpp project? Thanks