PlexAuth

@interface PlexAuth : NSObject

This class handles Plex Media Server authentication.

  • Authenticates a Plex account with a given username and password. If authentication is successful, the token is saved to the login keychain. @pram username The plex account’s username. @pram password The password for the provided account.

    Declaration

    Objective-C

    + (void)performplexlogin:(NSString *)username
                withPassword:(NSString *)password
                  completion:(void (^)(_Bool))completionHandler;

    Swift

    class func performplexlogin(_ username: String!, withPassword password: String!, completion completionHandler: ((Bool) -> Void)!)

    Parameters

    completionHandler

    The completion handler containing the success status

  • Removes a plex account

    Declaration

    Objective-C

    + (_Bool)removeplexaccount;

    Swift

    class func removeplexaccount() -> Bool

    Return Value

    bool If account removal is successful. *

  • Checks if a plex account exists in the Keychain. If so, return the username. If not, it will return a blank string.

    Declaration

    Objective-C

    + (NSString *)checkplexaccount;

    Swift

    class func checkplexaccount() -> String!

    Return Value

    NSString The username of the first account it found. *