Facebook Instant Game文件上传问题:提示需包含Bundle Config
上传Facebook Instant Game时提示缺少bundle config的排查方案
上传Facebook Instant Game文件时收到错误提示:“您的上传必须包含bundle config”,已添加
fbapp-config.json文件并引入Facebook Instant Games SDK,但问题仍未解决。
提供的代码文件
index.html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="/asset/boostrap/bootstrap.min.css"> <link href="/asset/css/index.css" rel="stylesheet"> <title>Trắc nghiệm lịch sử</title> </head> <body> <div class="vh-100 vw-100 d-flex justify-content-center"> <div class="position-relative contai h-100 bg-secondary p-2"> <div class="px-2 d-flex justify-content-between"> <div> <strong class="text-warning">Quiz</strong> </div> <div> <span class="text-warning">icon</span> </div> </div> <div class="px-2 pt-5"> <div class="" id="question"> <h5 class="text-white"></h5> </div> </div> <div class="pb-4 position-absolute bottom-0 start-0"> <div class="p-3 row gx-0 g-3" id="option_answer"> <!-- <div class="col-6"><button type="button">Lý Nam Đế</button></div> --> </div> <div class="w-100 text-center"> <button type="button" id="submit_answer" >Gửi Đáp án</button> <button type="button" id="next_question" >Tiếp tục</button> </div> </div> <div></div> </div> </div> <script src="https://connect.facebook.net/en_US/fbinstant.7.0.js"></script> <script src="./fbLoader.js"></script> </body> </html>
原fbapp-config.json(存在语法问题)
{ "instant_games": { "platform_version": "RICH_GAMEPLAY", "orientation": "LANDSCAPE", "navigation_menu_version": "NAV_FLOATING" } }
排查与修复步骤
修正JSON语法错误
你提供的fbapp-config.json中所有双引号被错误转义为",导致Facebook无法解析。替换为正确的纯JSON格式:{ "instant_games": { "platform_version": "RICH_GAMEPLAY", "orientation": "LANDSCAPE", "navigation_menu_version": "NAV_FLOATING" } }确认文件位置与命名
确保fbapp-config.json文件名完全匹配(大小写敏感),且放在上传压缩包的根目录,不能嵌套在子文件夹中。检查压缩包结构
上传的ZIP包必须直接包含index.html、fbapp-config.json及资源文件,不能将所有文件放在额外的子文件夹(如game/)中再压缩。验证SDK初始化逻辑
检查fbLoader.js中是否正确完成SDK初始化,必须调用FBInstant.initializeAsync(),示例:window.fbAsyncInit = function() { FBInstant.initializeAsync().then(() => { // 游戏初始化逻辑 }); };缺少初始化步骤会导致Facebook无法识别bundle配置。
校验JSON有效性
使用JSON校验工具确认fbapp-config.json无语法错误(如多余逗号、引号不匹配)。
内容的提问来源于stack exchange,提问作者trong tien
相关产品推荐
相关产品推荐

