gpt4 book ai didi

objective-c - 从我的应用程序启动 Facebook——空白页

转载 作者:行者123 更新时间:2023-11-28 20:46:35 24 4
gpt4 key购买 nike

我有一个关于在 iPhone/iPod/iPad 设备上启动 Facebook 的问题。我构建了一个应用程序,其中有一个启动官方 Facebook 应用程序的按钮(如果用户没有 Facebook 应用程序,它将在 Safari 中启动它)。所以这是我用来启动 Facebook 的代码:

NSURL *url = [NSURL URLWithString:@"fb://106452802751829"];
[[UIApplication sharedApplication] openURL:url];

但问题是它在 Facebook 应用程序中显示空白页面。我再次修改了代码,在我的 Facebook 粉丝页面的 ID 上检查了两次,但除了一个空白页面之外什么也没有。所以现在我不知道该怎么办。我希望有人可以帮助我在官方 Facebook 应用程序上启动实际的粉丝页面;谢谢。

最佳答案

查看此 Wiki iPhone URL Schemes

此信息来自 iPhoneDevTools 网站。

NSURL *url = [NSURL URLWithString:@"fb://<insert function here>"]; 
[UIApplication sharedApplication] openURL:url];

You can use these options: fb://profile – Open Facebook app to the user’s profile fb://friends – Open Facebook app to the friends list fb://notifications – Open Facebook app to the notifications list (NOTE: there appears to be a bug with this URL. The Notifications page opens.

However, it’s not possible to navigate to anywhere else in the Facebook app) fb://feed – Open Facebook app to the News Feed fb://events – Open Facebook app to the Events page fb://requests – Open Facebook app to the Requests list fb://notes- Open Facebook app to the Notes page fb://albums – - Open Facebook app to Photo Albums list This "works" but, then again, doesn't: fb://post/ It only works if the Facebook app has previously loaded the particular post, otherwise it draws a blank.

关于objective-c - 从我的应用程序启动 Facebook——空白页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5794388/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com