新 Facebook iOS 应用的自定义 URL 方案

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12125780/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 19:52:58  来源:igfitidea点击:

Custom URL scheme for new Facebook iOS app

iosfacebook

提问by nicktones

Does anyone know what the custom URL scheme is to open a Facebook page in their new iOS app. I was using fb://page/PAGE_ID however this doesn't seem to be working in the recently updated Facebook iOS app, it just opens the app but doesn't go to the required page.

有谁知道在他们的新 iOS 应用程序中打开 Facebook 页面的自定义 URL 方案是什么。我正在使用 fb://page/PAGE_ID 但这似乎在最近更新的 Facebook iOS 应用程序中不起作用,它只是打开应用程序但没有转到所需的页面。

回答by BSevo

I got this answer at developer.facebook.com:

我在developer.facebook.com得到了这个答案:

Replace the word pagewith profileand it will work. Your new statement will be:

个人资料替换单词页面,它将起作用。您的新声明将是:

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"fb://profile/247377102029332"]];

回答by Romano401

Use https://graph.facebook.com/YOUR_USERNAMEto get your page ID.

使用https://graph.facebook.com/YOUR_USERNAME获取您的页面 ID。

In your iOS app use: fb://profile/[your ID]and the facebook app will open to your page.

在您的 iOS 应用程序中使用:fb://profile/[your ID]Facebook 应用程序将打开您的页面。

回答by Dong Joon Lee

The URL scheme for the iOS Facebook application is:

iOS Facebook 应用程序的 URL 方案是:

fb://profile/(fbid)

fb://个人资料/(fbid)

回答by Nicholas

Same problem here. fb://page/PAGE_ID is not working anymore. Note that fb://profile/(fbid) wasn't working properly on Facebook 4.x returning a "corrupted" page in both iPad and iPhone. Instead, fb://profile/(fbid)/wallin Facebook 4.x worked well when using an iPad but didn't work with an iPhone.

同样的问题在这里。fb://page/PAGE_ID 不再工作。请注意,fb://profile/(fbid) 在 Facebook 4.x 上无法正常工作,在 iPad 和 iPhone 中返回“损坏的”页面。相反,Facebook 4.x 中的fb://profile/(fbid)/ wall在使用 iPad 时运行良好,但不适用于 iPhone。

fb://page/PAGE_ID was the only option that worked on both iPhone and iPad, based on my experience.

根据我的经验,fb://page/PAGE_ID 是唯一适用于 iPhone 和 iPad 的选项。

I used to use http://wiki.akosma.com/IPhone_URL_Schemesas reference, but it's currently down...

我曾经使用http://wiki.akosma.com/IPhone_URL_Schemes作为参考,但它目前已关闭...

回答by Vimal Venugopalan

A custom URL scheme is a mechanism through which third-party apps can communicate with each other. It doesn't allow you the provision to open a page in that particular application. It just fires an event to bring the called Application to the foreground. Going through this documentationwould further clear your doubts.

自定义 URL 方案是一种机制,第三方应用程序可以通过该机制相互通信。它不允许您在该特定应用程序中打开页面。它只是触发一个事件,将被调用的应用程序带到前台。阅读本文档将进一步消除您的疑虑。

The new Facebook app is built using Objective-C as against previous once in HTML5 which used to support URL scheme mechanism. This linkgives a hint on that.

新的 Facebook 应用程序是使用 Objective-C 构建的,而以前在 HTML5 中曾经支持 URL 方案机制。这个链接给出了一个提示。

http://techcrunch.com/2012/08/23/facebook-for-ios-faster/

http://techcrunch.com/2012/08/23/facebook-for-ios-faster/