不在标签页上的getSignedRequest为空 [英] getSignedRequest is null when not on a tab page

查看:102
本文介绍了不在标签页上的getSignedRequest为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在请求任何权限之前,我需要访问用户的区域设置。这通常在getSignedRequest中可用,但是当我直接查看应用程序而不是从页面选项卡中时,这似乎为NULL。所以当我去 apps.facebook.com/myapp / 时,它是空的,但当我通过一个页面,如 www .facebook.com /页/我的空间/的pageid?SK = APPID 。这是错误还是预期的行为?

I need to access the user's locale, before requesting any permissions from them. This is normally available in getSignedRequest but that appears to be NULL when I view the application directly rather than from within a page tab. So it is NULL when I go to apps.facebook.com/myapp/ but it has the correct values when I view it through a page like www.facebook.com/pages/mypage/pageid?sk=appid. Is this a bug or expected behavior? Do I have to use a different method when I won't be accessing the app through a page?

推荐答案

从我所记住的内容中我必须使用其他方法在Facebook上,签名的请求将仅在您的标签的第一页上可用 - 例如。 index.php。

From what I remember, on Facebook, a signed request will only be available on the first page of your tab - eg. index.php.

从这里,您需要存储检索到的值,并根据需要从本地存储或会话访问它们。

From here, you'll need to store the retrieved values and access them from local storage or a session as you need them.

另外,如果你直接看这个应用程序,那根本就不可用。你必须通过Facebook看这个方法才能使用。不幸的是,如果您希望这些信息不在页面标签之外,您必须首先请求权限。

Also, if you look at the the application directly it won't be available at all. You have to look at it through Facebook for this method to be available. Unfortunately you'll have to request permissions first if you want this information outside of the page tab.

祝你好运!

这篇关于不在标签页上的getSignedRequest为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆