从Facebook重定向到ios应用程序 - 深层链接 [英] Redirect from facebook to ios app - deep link
问题描述
我无法从Facebook帖子重定向到我的iOS应用。当我点击该帖子时,它会以网页形式打开(不知何故为iOS标识标签并且不会重定向到应用程序)。不确定它是ios应用程序或HTML内容还是其他一些问题。
Myapppp.plist内容:
<密钥GT; CFBundleURLTypes< /密钥GT;
< array>
< dict>
< key> CFBundleTypeRole< / key>
< string>编辑器< / string>
< key> CFBundleURLName< / key>
< string> com.myapp.xyzxyz< / string>
< key> CFBundleURLSchemes< / key>
< array>
< string> myapp< / string>
< / array>
< / dict>
< dict>
< key> CFBundleURLSchemes< / key>
< array>
< string> fb123XXX123< / string>
< / array>
< / dict>
< / array>
AppName:Myapp(按照plist)
< html lang =en>
< head>
< meta property =al:ios:urlcontent =myapp:// blahblah/>
< meta property =al:ios:app_store_idcontent =1234567/>
< meta property =al:ios:app_namecontent =Myapp blah blah/>
< / head>
当我只做 myapp://
从safari,它带我到我的应用程序,我也尝试手动打开 myapp:// blahblah
这也带我到应用程序。因此,我认为我的应用程序具有有效的链接。
当我从Facebook应用程序点击该帖子时,它会导航打开另一个包含底部一个工具栏的网页它上面有一个按钮&它显示了3个选项。其中一个是在myapp中打开
如果我尝试从Facebook应用程序打开一些其他应用程序(例如Instagaram帖子),它们也可以正常工作。
应用名称是否必须与我在 info.plist
中指定的名称相同,且中的名称相同meta_property
?或者还有其他错误吗?
这是预期的行为
不幸的是,目前无法从iOS Facebook应用程序中直接启动第三方应用程序。这是一个
I am not able to redirect to my iOS app from facebook post. When I click on that post its gets open as webpage (somehow dosent identify tags for iOS & dosen't redirect to app). Not sure whether its a ios app OR html content or some other issue.
Myapppp.plist content:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>com.myapp.xyzxyz</string>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp</string>
</array>
</dict>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>fb123XXX123</string>
</array>
</dict>
</array>
AppName: Myapp (As per plist)
<html lang="en">
<head>
<meta property="al:ios:url" content="myapp://blahblah"/>
<meta property="al:ios:app_store_id" content="1234567"/>
<meta property="al:ios:app_name" content="Myapp blah blah"/>
</head>
When I simply do "myapp://
" from safari, it takes me to my app and I also tried manually opening "myapp://blahblah
" which also takes me to app. Hence, I assume my app has valid linking.
When I click on that post from facebook app, it navigates an open that as another webpage which contains one toolbar at the bottom and has one button on it & it shows 3 option. one of them is "open in myapp"
If I try opening some other apps from Facebook app (for e.g. Instagaram post), they too work fine.
Does app name has to be excatly same what I have specified in info.plist
and the one in meta_property
? Or is there any other mistake ?
This is expected behavior
Unfortunately it is not currently possible to directly launch a third-party app from within the iOS Facebook app. This is a known issue that Facebook has essentially written off as wontfix
. This is still possible in the Android Facebook app, but it's unfortunate they haven't been more transparent about the change to the iOS version because there is quite a bit of confusion about it.
Instagram is a special case because it is a Facebook-owned app and gets different treatment.
But you can work around it
Services like Branch.io (full disclosure: I am on the team) get around this by implementing a judicious combination of App Links, URI schemes, and iOS Universal Links. Essentially what you need to do is open a page in the webview and then have a button or other user-driven CTA event that launches the app from there. It's an extra step for the user, but currently the best workaround. If you just want to be able to post a link that goes into your app when it is installed and otherwise goes to a webpage (or the App/Play Store), then Branch links are definitely your simplest solution.
Branch link routing logic
这篇关于从Facebook重定向到ios应用程序 - 深层链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!