简体   繁体   English

Facebook应用程序 - 移动和画布?

[英]Facebook app - Mobile and Canvas?

can an app in Facebook have desktop page for Facebook Canvas and a page for Facebook mobile at the same time? Facebook上的应用程序可以同时拥有Facebook Canvas的桌面页面和Facebook移动页面吗? Current I have a desktop app but if I create mobile pages on the same URL can I point the "Mobile Web" section of Facebook apps to that too? 目前我有一个桌面应用程序,但如果我在同一个URL上创建移动页面,我可以指向Facebook应用程序的“移动网络”部分吗?

Thanks 谢谢

can an app in Facebook have desktop page for Facebook Canvas and a page for Facebook mobile at the same time? Facebook上的应用程序可以同时拥有Facebook Canvas的桌面页面和Facebook移动页面吗?

Yes, sort of. 是的,有点。 There is no mobile canvas , if that's what you mean. 没有移动画布 ,如果这就是你的意思。 However, you can have a mobile web page and a desktop canvas app for the same app. 但是,您可以为同一个应用程序设置移动网页和桌面画布应用程序。

Current I have a desktop app but if I create mobile pages on the same URL can I point the "Mobile Web" section of Facebook apps to that too? 目前我有一个桌面应用程序,但如果我在同一个URL上创建移动页面,我可以指向Facebook应用程序的“移动网络”部分吗?

Yes you can use the same URL for both, then just detect the user agent to determine which to show. 是的,您可以为两者使用相同的URL,然后只检测用户代理以确定要显示的内容。

User agent sniffing is always a bad idea. 用户代理嗅探总是一个坏主意。 In the entry point of your application you should determine if it's desktop or mobile by checking for the 'signed request' variable that Facebook sends if the user is loading the app via a page tab within Facebook (ie a desktop user). 在应用程序的入口点,如果用户通过Facebook内的页面选项卡(即桌面用户)加载应用程序,则应通过检查Facebook发送的“已签名请求”变量来确定它是桌面还是移动。 If the user is accessing the app on mobile, outside of Facebook, then this variable won't be sent. 如果用户在Facebook之外的移动设备上访问应用程序,则不会发送此变量。

php: PHP:

if(isset($_REQUEST['signed_request']))
    //load desktop version
else
    //load mobile version

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM