I have created a simple game using cocos creator. When i test the game the games works fine both in browser and in the simulator. After building for fb-instant-games i upload the .zip file. the game works on the facebook platform. Great! Ok so now i try to implement some of the instant game functions. To start i just want to get the users name. I have followed these steps to set up and start an https server on the port 8080. (http://cocos2d-x.org/docs/creator/manual/en/publish/publish-fb-instant-games.html) no problem there. Then i navigate to https://localport:8080 and i have to (as described in the instructions) bypass the ssl error. The game doesn’t load. But at that point i didn’t worry because the docs say you need to embed the facebook game for it work using this url https://www.facebook.com/embed/instantgames/YOUR_GAME_ID/player?game_url=https://localhost:8080. But then i get the same issue. The index.html file loads, all the resources load. Bu the game doesn’t initialize. So i thought id see if just running it without ssl would work by going directly to the build\fb-instant-games\ folder in my browser. Again it doesn’t load. If i right click and go to view source, the html is there. it is loading index.html. But the game doesn’t initialize and there is no errors in chrome console. I am stuck for where to look or what to do. The game works fine if i upload to facebook. but on my local machine the game does not load. so i can’t test the facebook integration without having to upload the files to facebook every time.
in chrome dev console while on this page https://www.facebook.com/embed/instantgames/my game id/player?game_url=https://localhost:8080 i get this error in chrome repeating itself over and over
project.js:1 Uncaught TypeError: Cannot set property ‘string’ of null
at CCClass.start (project.js:1)
at CCClass.eval [as _invoke] (eval at o (cocos2d-js-min.js:1), :3:65)
at CCClass.invoke (cocos2d-js-min.js:1)
at CCClass.startPhase (cocos2d-js-min.js:1)
at e.mainLoop (cocos2d-js-min.js:1)
at t (cocos2d-js-min.js:1)
if i just go to https://localhost:8080 i don’t get any errors. but as i say the game wont load either.