-2

我有一个 sharekit 实现,一切正常,但是如果没有为 facebook 设置帐户,则在按下设置按钮后,操作表将被关闭,用户返回到应用程序,而不是系统首选项中的设置页面。

如何获取设置按钮以将用户发送到设置页面?

我用来初始化操作表的代码:

NSURL *url = [NSURL URLWithString:@"http://test"];
SHKItem *item = [SHKItem URL:url title:@"test"];


SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];

// Display the action sheet
[actionSheet showFromTabBar:self.tabBarController.tabBar];
4

1 回答 1

0

这是ShareKit的一个已知的、未解决的问题。你可以提交一个拉取请求来修复它,或者通过检查SLComposeViewController来解决它:

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {
    // show ShareKit
} else {
    // tell them to get Facebook
}

在显示 ShareKit 之前。当然,这会让没有 Facebook 的用户(比如只有 Twitter 的人)无法使用 ShareKit。另一方面,您可以切换到 Apple 的 Share Sheets,或者自己编写,但这些也有其缺点。有点像第22条。

于 2013-03-18T01:14:26.233 回答