1

iOS6. 設定アプリで Twitter にサインインしました。

アプリを閉じて、設定アプリを再実行しました。

ACAccountStore *store = [[ACAccountStore alloc] init];
ACAccountType *accountType = [store  accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[self createAccountPickerForAccountType:accountType withStore:store];

...

- (void)createAccountPickerForAccountType:(ACAccountType *)accountType withStore:
self.accounts = [store accountsWithAccountType:accountType];
[self displayAccountPicker];

返される配列は空の配列です。

4

1 に答える 1

5

これは私の電話でも見られますが、シミュレーターでは機能します。

私がやっている:

ACAccountStore *store = [[ACAccountStore alloc] init];
ACAccountType *twitterAccountType =
[store accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];

[store requestAccessToAccountsWithType:twitterAccountType options:nil^(BOOL granted, NSError *error) {

    NSArray *twitterAccounts =  [store accountsWithAccountType:twitterAccountType];
    int count = [twitterAccounts count];
}];

https://dev.twitter.com/docs/ios-frequently-asked-questionsから

「私のアプリケーションがtwitter.comの「from」ではなく「fromiOS」と見なされるのはなぜですか?

アプリケーションがまだAppStoreに公開されていない場合:

アトリビューションをtwitter.comに表示するには、リクエストを行うアプリケーションをAppleのAppStoreで起動する必要があります。アプリケーションのiOS5バージョンは、以前のバージョンだけでなく、ライブである必要があることに注意してください。」

私のアプリはまだアプリストアにないので、それができるのだろうか?

于 2012-12-22T22:49:42.757 に答える