0

嗨,兄弟们,当我上传游戏时,出现此问题的人可以帮助我,游戏必须通过我们的 CDN 引用我们支持的 SDK 之一。我真的需要了解为什么会发生这种情况,所以如果你能尽快帮助我,我将不胜感激谢谢

     FB.init({appId: '1039135876270670', 
        status: true, // Check login status
        cookie: true, // Enables cookies so server can access the session
        xfbml: true // Parse XFBML});
        
          var pos = 0, test, test_status, question, choice, choices, chA, chB, chC,chD, correct = 0;
    var questions = [
        [ "What is 10 + 4?", "12", "14", "16","20", "B" ],
    	[ "What is 20 - 9?", "7", "13", "11", "5","C" ],
    	[ "What is 7 x 3?", "21", "24", "25", "27","A" ],
    	[ "What is 8 / 2?", "10", "2", "4", "6","C" ]
    ];
    function _(x){
    	return document.getElementById(x);
    }
    function renderQuestion(){
    	test = _("test");
    	if(pos >= questions.length){
    		test.innerHTML = "<h2>Result<br> "+correct+" of "+questions.length+"</h2>";
    		_("test_status").innerHTML = "Test Completed";
    		pos = 0;
    		correct = 0;
    		return false;
    	}
    	_("test_status").innerHTML = "Question "+(pos+1)+" of "+questions.length;
    	question = questions[pos][0];
    	chA = questions[pos][1];
    	chB = questions[pos][2];
    	chC = questions[pos][3];
        chD = questions[pos][4];
    	test.innerHTML = "<div class='q'>"+question+"</div>";
    	test.innerHTML += "<label><input type='radio' name='choices' value='A'class='rad' ><span>"+chA+"</span></label>";
    	test.innerHTML += "<label><input type='radio' name='choices' value='B'class='rad' ><span>"+chB+"</span></label>";
    	test.innerHTML += "<label><input type='radio' name='choices' value='C'class='rad' ><span>"+chC+"</span></label>";
        test.innerHTML += "<label><input type='radio' name='choices' value='D'class='rad' ><span>"+chD+"</span></label>";
    	test.innerHTML += "<button class='btn' onclick='checkAnswer()'>Submit Answer</button>";
    }
    function checkAnswer(){
    	choices = document.getElementsByName("choices");
    	for(var i=0; i<choices.length; i++){
    		if(choices[i].checked){
    			choice = choices[i].value;
    		}
    	}
    	if(choice == questions[pos][5]){
    		correct++;
    	}
        else
        {
            correct--;
        }
    	pos++;
    	renderQuestion();
    }
    window.addEventListener("load", renderQuestion, false);
        <pre>
    <script src="http://connect.facebook.net/en_US/all.js" charset="utf-8"></script>
    <h2 id="test_status"></h2>
    <div id="test"></div>
    </pre>

4

1 回答 1

0

看起来您正在使用 Facebook Connect SDK。Instant Games 不支持 Facebook Connect SDK,它们仅适用于 Facebook Instant Games SDK。Instant Games SDK 不支持常规的 Facebook 登录,因为它们仅在 Facebook 中运行。

您最好在此处阅读入门指南:https ://developers.facebook.com/docs/games/instant-games/getting-started

于 2019-04-02T16:33:29.597 回答