PFSession

@interface PFSession : PFObject <PFSubclassing>

PFSession is a local representation of a session. This class is a subclass of a PFObject, and retains the same functionality as any other subclass of PFObject.

  • The session token string for this session.

    Declaration

    Objective-C

    @property (readonly, copy, nonatomic, nullable) NSString *sessionToken;

    Swift

    var sessionToken: String? { get }
  • Asynchronously fetches a PFSession object related to the current user.

    Declaration

    Objective-C

    + (nonnull BFTask<PFSession *> *)getCurrentSessionInBackground;

    Swift

    class func getCurrentSessionInBackground() -> BFTask

    Return Value

    A task that is completed with an instance of PFSession class or is faulted if the operation fails.

  • Asynchronously fetches a PFSession object related to the current user.

    Declaration

    Objective-C

    + (void)getCurrentSessionInBackgroundWithBlock:
        (nullable PFSessionResultBlock)block;

    Swift

    class func getCurrentSessionInBackground(block: PFSessionResultBlock? = nil)

    Parameters

    block

    The block to execute when the operation completes. It should have the following argument signature: ^(PFSession *session, NSError *error).