2016-05-19 14 views
2
SLComposeViewController.isAvailableForServiceType(SLServiceTypeTwitter) 

これはSocial.frameworkのメソッドです。isAvailableForServiceType(SLServiceTypeTwitter)は、インストールされているTwitterクライアントが常にtrueを返します。

このドキュメントでは、サービスがアクセス可能で、少なくとも1つのアカウントが設定されているかどうかを示すブール値を返します。

しかし、私はTwitterクライアントをインストールしたときに、設定がアカウントに追加されているかどうかに関係なく、常にtrueを返します。

iOS 9.3搭載iPhone 6s、iOS 9.0搭載iPhone 6 Plus、iOS 8.2搭載iPhone 5sなどの実際のデバイスでデモを実行します。

答えて

0

私は、ユーザーがすでにシステムのTwitterアカウントに

ACAccountStore *accountStore = [[ACAccountStore alloc] init]; 
    ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter]; 
    NSArray *twitterAccounts = [accountStore accountsWithAccountType:accountType]; 
を設定しているかどうかを判断するACAccountStoreを使用するのと同じproblem.andを持っています
関連する問題