ParseAnonymous
public struct ParseAnonymous<AuthenticatedUser> : ParseAuthentication where AuthenticatedUser : ParseUser
Provides utility functions for working with Anonymously logged-in users.
Anonymous users have some unique characteristics:
- Anonymous users don’t need a user name or password.
- Once logged out, an anonymous user cannot be recovered.
- When the current user is anonymous, the following methods can be used to switch to a different user or convert the anonymous user into a regular one:
- signup converts an anonymous user to a standard user with the given username and password. Data associated with the anonymous user is retained.
- login switches users without converting the anonymous user. Data associated with the anonymous user will be lost.
- Service login (e.g. Apple, Facebook, Twitter) will attempt to convert the anonymous user into a standard user by linking it to the service. If a user already exists that is linked to the service, it will instead switch to the existing user.
- Service linking (e.g. Apple, Facebook, Twitter) will convert the anonymous user into a standard user by linking it to the service.
-
Declaration
Swift
public static var __type: String { get }
-
Login a
ParseUser
synchronously using the respective authentication type.Throws
An error of typeParseError
.Declaration
Swift
func login(authData: [String: String]? = nil, options: API.Options = []) throws -> AuthenticatedUser
Parameters
authData
The authData for the respective authentication type.
options
A set of header options sent to the server. Defaults to an empty set.
Return Value
the linked
ParseUser
. -
Declaration
Swift
func login(authData: [String: String]? = nil, options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)
-
Declaration
Swift
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func loginPublisher(authData: [String: String]? = nil, options: API.Options = []) -> Future<AuthenticatedUser, ParseError>
-
Unavailable for
ParseAnonymous
. Will always return an error.Declaration
Swift
func link(authData: [String: String]? = nil, options: API.Options = [], callbackQueue: DispatchQueue = .main, completion: @escaping (Result<AuthenticatedUser, ParseError>) -> Void)
-
Declaration
Swift
@available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func linkPublisher(authData: [String: String]?, options: API.Options) -> Future<AuthenticatedUser, ParseError>