简体   繁体   English

Facebook共享链接无法在FB iOS App应用内浏览器中打开

[英]Facebook shared link does not open in FB iOS App in-app browser

We have a website deployed in a Ubuntu 14 server running Apache. 我们在运行Apache的Ubuntu 14服务器中部署了一个网站。 The website uses an SSL certificate (so you can access through https) and has a redirection for all the incoming requests without https. 该网站使用SSL证书(因此您可以通过https进行访问),并且对所有传入请求(没有https)进行重定向。

Ok, so the website is working as expected in desktop browsers and mobile browsers, but, when users tap on the links (from the Facebook iOS app) the in-app browser tries to open the website and returns a message like "Link doesn't work, try again" (not the exact message in english). 好的,因此该网站可以在桌面浏览器和移动浏览器中正常运行,但是,当用户点击链接(来自Facebook iOS应用程序)时,应用内浏览器会尝试打开该网站并返回“链接没有”之类的消息t工作,请重试” (不是英文的确切信息)。

After a lot of research I still don't have a clear idea of what this can happen (just found a couple of unresolved cases on google), so I'd start by looking at the server configuration. 经过大量研究,我仍然不清楚这会发生什么(只是在google上发现了几个未解决的案例),因此,我将从查看服务器配置开始。

The apache configuration (IP and domains are samples): apache配置(IP和域是示例):

<VirtualHost 200.200.200.200:80>
    ServerName www.domain.com
    Redirect permanent / https://www.domain.com/
</VirtualHost>

<VirtualHost domain.com:80>
    ServerName www.domain.com
    Redirect permanent / https://www.domain.com/
</VirtualHost>

<VirtualHost www.domain.com:443>
    ServerName www.domain.com
    ServerAlias domain.com

    SSLEngine on
    SSLCertificateFile /home/ssl/www.domain.com.crt
    SSLCertificateKeyFile /home/ssl/domain.com.key

    ServerAdmin admin@domain.com
    DocumentRoot /var/www/html
    <Directory /var/www/html>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>

The .htaccess file: .htaccess文件:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

The previous configuration works fine in all browsers, it just doesn't load (doesn't even makes it to Apache access log) when loaded with Facebook iOS in-app browser. 先前的配置在所有浏览器中都可以正常运行,但在加载Facebook iOS应用内浏览器后,它只是不加载(甚至不进入Apache访问日志)。

Help is much appreciated! 非常感谢帮助! Thanks in advance for your time. 在此先感谢您的时间。

After analyzing the url with the SSL Checker suggested by @CBoroe, I find out that there was a missing intermediate certificate configuration that needed to be added because we're using Apache < 2.4.8 version. 在使用@CBoroe建议的SSL Checker分析了url之后,我发现由于我们使用的是Apache <2.4.8版本,因此需要添加缺少的中间证书配置。

We just had to add the SSLCertificateChainFile /home/cert_ssl/intermediate.crt directive. 我们只需要添加SSLCertificateChainFile /home/cert_ssl/intermediate.crt指令。 The final SSL part of the code looks like this: 代码的最后SSL部分如下所示:

SSLEngine on
SSLCertificateFile /home/ssl/www.domain.com.crt
SSLCertificateKeyFile /home/ssl/domain.com.key
SSLCertificateChainFile /home/ssl/intermediate.crt

Hope this helps someone else having this issue. 希望这可以帮助其他遇到此问题的人。 After this change, restart Apache with: 进行此更改后,请使用以下命令重新启动Apache:

service apache2 restart

And everything should work fine (you can use the same SSL checker tool to validate it). 一切都应该正常工作(您可以使用相同的SSL检查器工具进行验证)。

Thanks for your time! 谢谢你的时间!

暂无
暂无

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

相关问题 IOS Facebook SDK 3.1 ::使用fb登录sos sdk 3.1:只有openActiveSession才能进行应用内登录 - IOS Facebook SDK 3.1 :: login with fb ios sdk 3.1: Only openActiveSession does in-app login Facebook登录无法使用iOS应用内浏览器 - Facebook login is not working In-app browser for iOS 通过Facebook帖子上的共享链接打开iOS应用 - Open an iOS app from a shared link on a Facebook post 如何制作在Safari中为iOS Facebook Messenger Messenger应用而不是应用内网络浏览器打开的URL - How to make url that open in Safari for iOS Facebook Messenger app instead of in-app web browser Facebook应用程序登录请求未在FB iOS应用程序中打开,而是在Safari移动浏览器中打开 - Facebook app login request do not open in FB iOS app , it opens in Safari mobile browser iOS 应用内浏览器 - iOS in-App browser 在浏览器或本机应用程序中正确打开Facebook页面链接IOS cordova - Open facebook page link in browser or native app correctly IOS cordova iOS Facebook App浏览器 - 强制链接在Safari中打开 - iOS Facebook App browser - force link to open in Safari 如何将链接嵌入到要在Facebook上共享的照片中,就像Dropbox应用处理FB照片共享一样? - How can I embed a link into a photo to be shared on Facebook, like Dropbox app does with FB photo share? Safari中的iOS开放网址,而不是Facebook应用内浏览器JS,HTML - iOS open URL in safari instead of Facebook in-app browser JS, HTML
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM