Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

TWAPIManager:isLocalTwitterAccountAvailable not working simulator #2

Closed
yelled3 opened this issue Mar 18, 2013 · 2 comments
Closed

Comments

@yelled3
Copy link

yelled3 commented Mar 18, 2013

// this method always returns YES in simulator
if([TWAPIManager isLocalTwitterAccountAvailable]) {

this is actually due to:
http://stackoverflow.com/questions/12811906/isavailableforservicetype-always-returns-true

must be a better way to do this, no?

@yelled3
Copy link
Author

yelled3 commented Mar 18, 2013

ok, this does the trick:

ACAccountStore *accountStore = [[ACAccountStore alloc] init];
    ACAccountType *twitterAccountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
    NSArray *twitterAccounts = [accountStore accountsWithAccountType:twitterAccountType];

    if (twitterAccounts.count > 0) {
        NSLog(@"you good");
    }
    else{
        NSLog(@"nada!");
    }

@seivan
Copy link
Member

seivan commented Mar 19, 2013

Thanks. I'll patch it with that. I already got AC* instances so I'll just use them.
Also I wasn't sure if you could access the accounts without permission request first. Looks like you can :-)

Anyway I'm closing this and referencing it in the actual repo that contains the code base.
seivan-archives/TWReverseAuth#1

@seivan seivan closed this as completed Mar 19, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants