ParseTwitter
public struct ParseTwitter<AuthenticatedUser> : ParseAuthentication where AuthenticatedUser : ParseUser
Provides utility functions for working with Twitter User Authentication and ParseUser
‘s.
Be sure your Parse Server is configured for sign in with Twitter.
For information on acquiring Twitter sign-in credentials to use with ParseTwitter
, refer to Twitter’s Documentation.
-
Declaration
Swift
public static var __type: String { get }
-
Declaration
Swift
public init()
-
Login a
ParseUser
asynchronously using Twitter authentication.Throws
An error of typeParseError
.Declaration
Swift
func login(userId: String, screenName: String? = nil, consumerKey: String, consumerSecret: String, authToken: String, authTokenSecret: String, options: API.Options = []) async throws -> AuthenticatedUser
Parameters
user
The id from Twitter.
screenName
The
user screenName
from Twitter.consumerKey
The
consumerKey
from Twitter.consumerSecret
The
consumerSecret
from Twitter.authToken
The Twitter
authToken
obtained from Twitter.authTokenSecret
The Twitter
authSecretToken
obtained from Twitter.options
A set of header options sent to the server. Defaults to an empty set.
Return Value
An instance of the logged in
ParseUser
. -
login(authData:
Asynchronousoptions: ) Login a
ParseUser
asynchronously using Twitter authentication.Throws
An error of typeParseError
.Declaration
Swift
func login(authData: [String: String], options: API.Options = []) async throws -> AuthenticatedUser
Parameters
authData
Dictionary containing key/values.
options
A set of header options sent to the server. Defaults to an empty set.
Return Value
An instance of the logged in
ParseUser
. -
Link the current
ParseUser
asynchronously using Twitter authentication.Throws
An error of typeParseError
.Declaration
Swift
func link(userId: String, screenName: String? = nil, consumerKey: String, consumerSecret: String, authToken: String, authTokenSecret: String, options: API.Options = []) async throws -> AuthenticatedUser
Parameters
user
The
user
from Twitter.screenName
The
user screenName
from Twitter.consumerKey
The
consumerKey
from Twitter.consumerSecret
The
consumerSecret
from Twitter.authToken
The Twitter
authToken
obtained from Twitter.authTokenSecret
The Twitter
authSecretToken
obtained from Twitter.options
A set of header options sent to the server. Defaults to an empty set.
Return Value
An instance of the logged in
ParseUser
. -
link(authData:
Asynchronousoptions: ) Link the current
ParseUser
asynchronously using Twitter authentication.Throws
An error of typeParseError
.Declaration
Swift
func link(authData: [String: String], options: API.Options = []) async throws -> AuthenticatedUser
Parameters
authData
Dictionary containing key/values.
options
A set of header options sent to the server. Defaults to an empty set.
Return Value
An instance of the logged in
ParseUser
.
-
Login a
ParseUser
asynchronously using Twitter authentication. Publishes when complete.Declaration
Swift
func loginPublisher(userId: String, screenName: String? = nil, consumerKey: String, consumerSecret: String, authToken: String, authTokenSecret: String, options: API.Options = []) -> Future<AuthenticatedUser, ParseError>
Parameters
user
The id from Twitter.
screenName
The
user screenName
from Twitter.consumerKey
The
consumerKey
from Twitter.consumerSecret
The
consumerSecret
from Twitter.authToken
The Twitter
authToken
obtained from Twitter.authTokenSecret
The Twitter
authSecretToken
obtained from Twitter.options
A set of header options sent to the server. Defaults to an empty set.
Return Value
A publisher that eventually produces a single value and then finishes or fails.
-
Login a
ParseUser
asynchronously using Twitter authentication. Publishes when complete.Declaration
Swift
func loginPublisher(authData: [String: String], options: API.Options = []) -> Future<AuthenticatedUser, ParseError>
Parameters
authData
Dictionary containing key/values.
options
A set of header options sent to the server. Defaults to an empty set.
Return Value
A publisher that eventually produces a single value and then finishes or fails.
-
Link the current
ParseUser
asynchronously using Twitter authentication. Publishes when complete.Declaration
Swift
func linkPublisher(userId: String, screenName: String? = nil, consumerKey: String, consumerSecret: String, authToken: String, authTokenSecret: String, options: API.Options = []) -> Future<AuthenticatedUser, ParseError>
Parameters
user
The
user
from Twitter.screenName
The
user screenName
from Twitter.consumerKey
The
consumerKey
from Twitter.consumerSecret
The
consumerSecret
from Twitter.authToken
The Twitter
authToken
obtained from Twitter.authTokenSecret
The Twitter
authSecretToken
obtained from Twitter.options
A set of header options sent to the server. Defaults to an empty set.
Return Value
A publisher that eventually produces a single value and then finishes or fails.
-
Link the current
ParseUser
asynchronously using Twitter authentication. Publishes when complete.Declaration
Swift
func linkPublisher(authData: [String: String], options: API.Options = []) -> Future<AuthenticatedUser, ParseError>
Parameters
authData
Dictionary containing key/values.
options
A set of header options sent to the server. Defaults to an empty set.
Return Value
A publisher that eventually produces a single value and then finishes or fails.
-
login(userId:
screenName: authToken: authTokenSecret: consumerKey: consumerSecret: options: callbackQueue: completion: ) Login a
ParseUser
asynchronously using Twitter authentication.Declaration
Swift
func login(userId: String, screenName: String? = nil, authToken: String, authTokenSecret: String, consumerKey: String, consumerSecret: String, options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)
Parameters
userId
The
Twitter userId
from Twitter.screenName
The
Twitter screenName
from Twitter.consumerKey
The
Twitter consumerKey
from Twitter.consumerSecret
The
Twitter consumerSecret
from Twitter.authToken
The Twitter
authToken
obtained from Twitter.authTokenSecret
The Twitter
authSecretToken
obtained from Twitter.options
A set of header options sent to the server. Defaults to an empty set.
callbackQueue
The queue to return to after completion. Default value of .main.
completion
The block to execute.
-
Declaration
Swift
func login(authData: [String: String], options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)
-
link(userId:
screenName: consumerKey: consumerSecret: authToken: authTokenSecret: options: callbackQueue: completion: ) Link the current
ParseUser
asynchronously using Twitter authentication.Declaration
Swift
func link(userId: String, screenName: String? = nil, consumerKey: String, consumerSecret: String, authToken: String, authTokenSecret: String, options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)
Parameters
user
The id from Twitter.
screenName
The
user screenName
from Twitter.consumerKey
The
consumerKey
from Twitter.consumerSecret
The
consumerSecret
from Twitter.authToken
The Twitter
authToken
obtained from Twitter.authTokenSecret
The Twitter
authSecretToken
obtained from Twitter.options
A set of header options sent to the server. Defaults to an empty set.
completion
The block to execute.
-
Declaration
Swift
func link(authData: [String: String], options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)