-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPFSession.h
More file actions
52 lines (39 loc) · 1.37 KB
/
PFSession.h
File metadata and controls
52 lines (39 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// PFSession.h
//
// Copyright 2011-present Parse Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#if TARGET_OS_IPHONE
#import <Parse/PFObject.h>
#import <Parse/PFSubclassing.h>
#else
#import <ParseOSX/PFObject.h>
#import <ParseOSX/PFSubclassing.h>
#endif
PF_ASSUME_NONNULL_BEGIN
@class PFSession;
typedef void(^PFSessionResultBlock)(PFSession *PF_NULLABLE_S session, NSError *PF_NULLABLE_S error);
/*!
`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>.
*/
@interface PFSession : PFObject<PFSubclassing>
/*!
@abstract The session token string for this session.
*/
@property (PF_NULLABLE_PROPERTY nonatomic, copy, readonly) NSString *sessionToken;
/*!
*Asynchronously* fetches a `PFSession` object related to the current user.
@returns A task that is `completed` with an instance of `PFSession` class or is `faulted` if the operation fails.
*/
+ (BFTask *)getCurrentSessionInBackground;
/*!
*Asynchronously* fetches a `PFSession` object related to the current user.
@param block The block to execute when the operation completes.
It should have the following argument signature: `^(PFSession *session, NSError *error)`.
*/
+ (void)getCurrentSessionInBackgroundWithBlock:(PF_NULLABLE PFSessionResultBlock)block;
@end
PF_ASSUME_NONNULL_END