PF_Twitter Class Reference

Inherits from NSObject
Declared in PF_Twitter.h

Overview

The PF_Twitter class is a simple interface for interacting with the Twitter REST API, automating sign-in and OAuth signing of requests against the API.

  consumerKey

Consumer key of the application that is used to authorize with Twitter.

@property (nullable, nonatomic, copy) NSString *consumerKey

Declared In

PF_Twitter.h

  consumerSecret

Consumer secret of the application that is used to authorize with Twitter.

@property (nullable, nonatomic, copy) NSString *consumerSecret

Declared In

PF_Twitter.h

  authToken

Auth token for the current user.

@property (nullable, nonatomic, copy) NSString *authToken

Declared In

PF_Twitter.h

  authTokenSecret

Auth token secret for the current user.

@property (nullable, nonatomic, copy) NSString *authTokenSecret

Declared In

PF_Twitter.h

  userId

Twitter user id of the currently signed in user.

@property (nullable, nonatomic, copy) NSString *userId

Declared In

PF_Twitter.h

  screenName

Twitter screen name of the currently signed in user.

@property (nullable, nonatomic, copy) NSString *screenName

Declared In

PF_Twitter.h

– authorizeInBackground

Displays an auth dialog and populates the authToken, authTokenSecret, userId, and screenName properties if the Twitter user grants permission to the application.

- (BFTask *)authorizeInBackground

Return Value

The task, that encapsulates the work being done.

Declared In

PF_Twitter.h

– authorizeWithSuccess:failure:cancel:

Displays an auth dialog and populates the authToken, authTokenSecret, userId, and screenName properties if the Twitter user grants permission to the application.

- (void)authorizeWithSuccess:(nullable void ( ^ ) ( void ))success failure:(nullable void ( ^ ) ( NSError *error ))failure cancel:(nullable void ( ^ ) ( void ))cancel

Parameters

success

Invoked upon successful authorization.

failure

Invoked upon an error occurring in the authorization process.

cancel

Invoked when the user cancels authorization.

Declared In

PF_Twitter.h

– signRequest:

Adds a 3-legged OAuth signature to an NSMutableURLRequest based upon the properties set for the Twitter object.

- (void)signRequest:(nullable NSMutableURLRequest *)request

Parameters

request

Request to sign.

Discussion

Use this function to sign requests being made to the Twitter API.

Declared In

PF_Twitter.h