PFTwitterUtils-NativeTwitter
PFTwitterUtils-NativeTwitter copied to clipboard
Request: Example class.
Is there any way you could provide an example class with the implementation as opposed to just the README? Thanks for the library!
Hey Mark,
I don't have a sample app for this yet but in the future I may add one. Let me know if this helps you:
First make sure you import these files:
#import <Accounts/Accounts.h>
#import <Twitter/Twitter.h>
#import "PFTwitterUtils+NativeTwitter.h"
Then, when you want to start the sign in process you'll do something like this...
[PFTwitterUtils getTwitterAccounts:^(BOOL accountsWereFound, NSArray *twitterAccounts) {
// Let's just pretend the user selected the first account...
// Normally, we would display these in a UIActionSheet or something...
ACAccount *selectedAccount = [twitterAccounts objectAtIndex:0];
// Give that account back to PFTwitterUtils and log in!
[PFTwitterUtils logInWithAccount:selectedAccount];
}];
That's it! You'll want to make sure you set a completion block so that you know when the sign-in finishes like this:
[PFTwitterUtils setNativeLogInSuccessBlock:^(PFUser *user, NSString *userTwitterId, NSError *error) {
// Store user information...
}];
@mstrchrstphr This was very helpful Thank you. I am having an authentication issue but I opened a separate ticket for that. #2.