jjzjj

acaccountstore

全部标签

ios - isAvailableForServiceType(SLServiceTypeTwitter) 在安装 Twitter 客户端时总是返回 true

SLComposeViewController.isAvailableForServiceType(SLServiceTypeTwitter)这是Social.framework中的一个方法。文档说该方法返回一个bool值,表示该服务是否可以访问,并且至少设置了一个帐户。但是当我安装推特客户端时,无论是否在设置中添加该帐户,该方法总是返回true。我在真实设备上运行演示,例如装有iOS9.3的iPhone6s、装有iOS9.0的iPhone6Plus、装有iOS8.2的iPhone5s。 最佳答案 我也有同样的问题,我用ACAcco

ios - ACAccountStore 请求AccessToAccountsWithType :options:completion always showing permissions prompt

如标题所示,我对ACAccountStorerequestAccessToAccountsWithType:options:completion方法有疑问。我希望此方法仅在第一次为我的应用程序调用时提示用户许可,但它每次都会显示。有没有什么方法可以检查用户是否已授予权限,这样我就不必请求了?还是有其他魔法可以阻止这种行为?我觉得这很奇怪,因为在同一应用程序的早期版本中,行为符合我的预期——它只在第一次调用时提示权限。 最佳答案 回答我自己的问题。希望有一天有人会发现这很有用。问题的原因似乎是我的应用可用的权限(尤其是基本读取权限)与

ios - 从 ACAccountStore/ACAccount 检索 Facebook token 过期?

在使用ACAccountStore和ACAccount时,有什么方法可以判断您的Facebooktoken何时过期?我创建了一个ACAccountStore,获得了对用户facebook帐户的访问权限,将该帐户存储在一个ACAccount对象中,并且能够从凭据中检索token。不过,我还想知道此token何时过期。我将如何取消此token的到期时间?或者有可能吗? 最佳答案 您为什么想知道什么时候到期?当您获得token时,就Facebook而言,它的token生命周期会延长。我认为今天这是额外的60天。因此,当您从帐户商店获得它时

iOS requestAccessToAccountsWithType 不显示权限提示/NSAlert

据我了解,当我调用[ACAccountStorerequestAccessToAccountsWithType:options:completion]时,用户应该会看到一个UIAlert,询问他们是否授予我的应用程序权限。当我运行这段代码时,从来没有提示,granted变量始终为“false”-(void)myfunction{if(!_accountStore)_accountStore=[[ACAccountStorealloc]init];ACAccountType*fbActType=[_accountStoreaccountTypeWithAccountTypeIdentif

ios - ACAccountStore 请求AccessToAccountsWithType :options:completion: returning nil error and granted as NO

我正在尝试使用ACAccountStore进行登录测试,但效果不是很好。我正在尝试像这样访问该帐户:ACAccountStore*store=[ACAccountStorenew];ACAccountType*accountType=[storeaccountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];NSDictionary*options=@{ACFacebookAppIdKey:@"12345678987654",ACFacebookPermissionsKey:@[@"email"]};[stor

ios - ACAccountStore 在设备上返回空数组但在模拟器上工作

我正在开发一个应用程序,我想在其中使用SLRequest发布到Twitter。我已经让它在模拟器上工作,但它在我的设备上不起作用。[self.accountStoraccountsWithAccountType:accountTypeTwitter];在我的设备上返回一个空数组,但它在模拟器上显示正确的帐户。我不知道为什么会这样。我有一种方法可以获取用户的Twitter帐户。它看起来像这样:-(void)fetchTwitterAccounts{if(self.accountStore==nil){self.accountStore=[[ACAccountStorealloc]init

ios - 调用 [ACAccountStore requestAccessToAccountsWithType] 时获取 "Error Code 8"- iOS Facebook

我一直在搜索Google和SO,但找不到com.apple.accounts错误代码8的含义。我正在尝试使用iOS6和FacebookSDK。我运行这个请求;if(!_accountStore)_accountStore=[[ACAccountStorealloc]init];ACAccountType*fbActType=[_accountStoreaccountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierFacebook];NSDictionary*options=[[NSDictionaryalloc]initWith

ios - 使用 ACAccountStore 保存 Facebook 帐户

我正在尝试使用iOSSocial.framework分享到Facebook。但是,大多数用户不会在“设置”>“Facebook”中设置Facebook,因此当您打开UIActivityViewController时,Facebook不会出现,只是没有列出。(参见UIActivitywithnosettingsforFacebook或只是谷歌“facebookdoesn'tshowinUIActivityViewController”,有很多人试图解决这个问题。)我们的应用程序已经使用了FacebookSDK,所以我可以获取Facebook帐户信息,所以我想我应该只获取信息,然后将信息保

ios - 使用未声明的标识符 "ACAccountStore"

我正在尝试使用ios帐户框架。我已经在构建阶段添加了Accounts.Framework,但我仍然收到错误Useofundeclaredidentifier"ACAccountStore"有人知道为什么吗?Social.Framework适合我。 最佳答案 您确定包含标题了吗?objective-C#importswiftimportAccounts 关于ios-使用未声明的标识符"ACAccountStore",我们在StackOverflow上找到一个类似的问题:

ios - ACAccountStore accountsWithAccountType 返回空列表但访问请求被授予

我有以下一段Swift代码可以连接到我的iOS模拟器中的Twitter帐户。我对requestAccessToAccountsWithType的调用被授予,但ACAccountStore.accountsWithAccountType返回一个空列表。我错过了什么?letaccountStore=ACAccountStore()lettwitterAccountType=accountStore.accountTypeWithAccountTypeIdentifier(ACAccountTypeIdentifierTwitter)accountStore.requestAccessToA
12