Javascript Facebook即时游戏-游戏中接收有效负载数据时出现问题
我试图使用PAYLOAD param,正如文档所述,这是在游戏中使用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上的应用程序 到目前为
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());
});代码>