Skip to content

Instantly share code, notes, and snippets.



Created Sep 10, 2012
What would you like to do?
Accessing Twitter Accounts in iOS5+ via RubyMotion
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/
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment