Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/476.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Facebook即时游戏-游戏中接收有效负载数据时出现问题_Javascript_Facebook_Facebook Instant Games - Fatal编程技术网

Javascript Facebook即时游戏-游戏中接收有效负载数据时出现问题

Javascript Facebook即时游戏-游戏中接收有效负载数据时出现问题,javascript,facebook,facebook-instant-games,Javascript,Facebook,Facebook Instant Games,我试图使用PAYLOAD param,正如文档所述,这是在游戏中使用FBInstant.getEntryPointData解析/接收URL参数的唯一方法,在我的例子中,它总是返回null 我在一款最流行的认识你的朋友游戏中看到过类似的方法,该游戏在url param&payload=encoded_json_此处发送编码的json,其中包含有关用户试图打开的路线的信息 我的应用程序还没有发布,所以我正在使用FacebookURL测试它,该URL嵌入了运行在localhost上的应用程序 到目前为

我试图使用PAYLOAD param,正如文档所述,这是在游戏中使用
FBInstant.getEntryPointData
解析/接收URL参数的唯一方法,在我的例子中,它总是返回null

我在一款最流行的
认识你的朋友
游戏中看到过类似的方法,该游戏在url param
&payload=encoded_json_此处发送编码的json,其中包含有关用户试图打开的路线的信息

我的应用程序还没有发布,所以我正在使用FacebookURL测试它,该URL嵌入了运行在localhost上的应用程序

到目前为止,我所尝试的是添加

https://www.facebook.com/embed/instantgames/GAME_ID/player?game_url=http%3A%2F%2Flocalhost%3A8000%2F&&payload=ENCODED_JSON_HERE

但是在调用FBInstant.getEntryPointData
时,我无法看到此信息

这是我的代码片段,在这里我可以获得经过身份验证的用户的数据,但不能获得有效负载

FBInstant.startGameAsync()。然后(()=>{
this.startGame=true;
this.userInfo.photo=FBInstant.player.getPhoto();
this.userInfo.name=FBInstant.player.getName();
this.userInfo.id=FBInstant.player.getID();
this.userInfo.type=FBInstant.context.getType();
this.userInfo.contextId=FBInstant.context.getID();
log(FBInstant.getEntryPointData());
});