Skip to content

Instantly share code, notes, and snippets.

@tmilewski
Created September 10, 2012 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmilewski/3692734 to your computer and use it in GitHub Desktop.
Save tmilewski/3692734 to your computer and use it in GitHub Desktop.
Accessing Twitter Accounts in iOS5+ via RubyMotion
GOTCHAS:
Adding a Twitter account via the iOS5 simulator does not seem to work. Therefore, you'll need to upgrade to the iOS 6.0 Beta.
cd /Library/RubyMotion/data/6.0
rake update --trace
sudo xcode-select -switch /Applications/Xcode45-DP4.app/Contents/Developer/
PLEASE NOTE:
- Developer Preview 4 was the most current release at the time of writing this.
- None of the code below is specific to the iOS 6.0 Beta.
- iOS 6.0 Beta is a *Pre-Release* version of iOS. It is *Apple Confidential Information*. It cannot be discussed here because this is a public forum. Please do not post code that contains iOS 6.0 information (such as API calls) in public places (here or GitHub for instance).
- Xcode 4.5 Developer Preview / iOS 6.0 Beta can't be used for App Store submissions at this point.
def loadTwitterAccounts
@accountStore = ACAccountStore.alloc.init
@accountType = @accountStore.accountTypeWithAccountTypeIdentifier(ACAccountTypeIdentifierTwitter)
@accountStore.requestAccessToAccountsWithType @accountType, withCompletionHandler: lambda { |granted, error|
UIApplication.sharedApplication.terminateWithSuccess unless granted
@accounts = @accountStore.accountsWithAccountType(@twitterAccountType) || []
# Do what you will with @accounts
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment