22
22
#import < FBSDKCoreKit/FBSDKGraphRequestConnection.h>
23
23
#import < FBSDKCoreKit/FBSDKMacros.h>
24
24
25
- /* !
26
- @abstract Notification indicating that the `currentAccessToken` has changed.
27
- @discussion the userInfo dictionary of the notification will contain keys
25
+ /* *
26
+ Notification indicating that the `currentAccessToken` has changed.
27
+
28
+ the userInfo dictionary of the notification will contain keys
28
29
`FBSDKAccessTokenChangeOldKey` and
29
30
`FBSDKAccessTokenChangeNewKey`.
30
31
*/
31
32
FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeNotification;
32
33
33
- /* !
34
- @abstract A key in the notification's userInfo that will be set
34
+ /* *
35
+ A key in the notification's userInfo that will be set
35
36
if and only if the user ID changed between the old and new tokens.
36
- @discussion Token refreshes can occur automatically with the SDK
37
+
38
+ Token refreshes can occur automatically with the SDK
37
39
which do not change the user. If you're only interested in user
38
40
changes (such as logging out), you should check for the existence
39
41
of this key. The value is a NSNumber with a boolValue.
@@ -45,74 +47,76 @@ FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeNotification;
45
47
FBSDK_EXTERN NSString *const FBSDKAccessTokenDidChangeUserID;
46
48
47
49
/*
48
- @abstract key in notification's userInfo object for getting the old token.
49
- @discussion If there was no old token, the key will not be present.
50
+ key in notification's userInfo object for getting the old token.
51
+
52
+ If there was no old token, the key will not be present.
50
53
*/
51
54
FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeOldKey;
52
55
53
56
/*
54
- @abstract key in notification's userInfo object for getting the new token.
55
- @discussion If there is no new token, the key will not be present.
57
+ key in notification's userInfo object for getting the new token.
58
+
59
+ If there is no new token, the key will not be present.
56
60
*/
57
61
FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeNewKey;
58
62
59
63
60
- /* !
61
- @class FBSDKAccessToken
62
- @abstract Represents an immutable access token for using Facebook services.
64
+ /* *
65
+ Represents an immutable access token for using Facebook services.
63
66
*/
64
67
@interface FBSDKAccessToken : NSObject <FBSDKCopying, NSSecureCoding >
65
68
66
- /* !
67
- @abstract Returns the app ID.
69
+ /* *
70
+ Returns the app ID.
68
71
*/
69
72
@property (readonly , copy , nonatomic ) NSString *appID;
70
73
71
- /* !
72
- @abstract Returns the known declined permissions.
74
+ /* *
75
+ Returns the known declined permissions.
73
76
*/
74
77
@property (readonly , copy , nonatomic ) NSSet *declinedPermissions;
75
78
76
- /* !
77
- @abstract Returns the expiration date.
79
+ /* *
80
+ Returns the expiration date.
78
81
*/
79
82
@property (readonly , copy , nonatomic ) NSDate *expirationDate;
80
83
81
- /* !
82
- @abstract Returns the known granted permissions.
84
+ /* *
85
+ Returns the known granted permissions.
83
86
*/
84
87
@property (readonly , copy , nonatomic ) NSSet *permissions;
85
88
86
- /* !
87
- @abstract Returns the date the token was last refreshed.
89
+ /* *
90
+ Returns the date the token was last refreshed.
88
91
*/
89
92
@property (readonly , copy , nonatomic ) NSDate *refreshDate;
90
93
91
- /* !
92
- @abstract Returns the opaque token string.
94
+ /* *
95
+ Returns the opaque token string.
93
96
*/
94
97
@property (readonly , copy , nonatomic ) NSString *tokenString;
95
98
96
- /* !
97
- @abstract Returns the user ID.
99
+ /* *
100
+ Returns the user ID.
98
101
*/
99
102
@property (readonly , copy , nonatomic ) NSString *userID;
100
103
101
104
- (instancetype )init NS_UNAVAILABLE;
102
105
+ (instancetype )new NS_UNAVAILABLE;
103
106
104
- /* !
105
- @abstract Initializes a new instance.
106
- @param tokenString the opaque token string.
107
- @param permissions the granted permissions. Note this is converted to NSSet and is only
107
+ /* *
108
+ Initializes a new instance.
109
+ - Parameter tokenString: the opaque token string.
110
+ - Parameter permissions: the granted permissions. Note this is converted to NSSet and is only
108
111
an NSArray for the convenience of literal syntax.
109
- @param declinedPermissions the declined permissions. Note this is converted to NSSet and is only
112
+ - Parameter declinedPermissions: the declined permissions. Note this is converted to NSSet and is only
110
113
an NSArray for the convenience of literal syntax.
111
- @param appID the app ID.
112
- @param userID the user ID.
113
- @param expirationDate the optional expiration date (defaults to distantFuture).
114
- @param refreshDate the optional date the token was last refreshed (defaults to today).
115
- @discussion This initializer should only be used for advanced apps that
114
+ - Parameter appID: the app ID.
115
+ - Parameter userID: the user ID.
116
+ - Parameter expirationDate: the optional expiration date (defaults to distantFuture).
117
+ - Parameter refreshDate: the optional date the token was last refreshed (defaults to today).
118
+
119
+ This initializer should only be used for advanced apps that
116
120
manage tokens explicitly. Typical login flows only need to use `FBSDKLoginManager`
117
121
along with `+currentAccessToken`.
118
122
*/
@@ -125,38 +129,41 @@ FBSDK_EXTERN NSString *const FBSDKAccessTokenChangeNewKey;
125
129
refreshDate : (NSDate *)refreshDate
126
130
NS_DESIGNATED_INITIALIZER;
127
131
128
- /* !
129
- @abstract Convenience getter to determine if a permission has been granted
130
- @param permission The permission to check.
132
+ /* *
133
+ Convenience getter to determine if a permission has been granted
134
+ - Parameter permission: The permission to check.
131
135
*/
132
136
- (BOOL )hasGranted : (NSString *)permission ;
133
137
134
- /* !
135
- @abstract Compares the receiver to another FBSDKAccessToken
136
- @param token The other token
137
- @return YES if the receiver's values are equal to the other token's values; otherwise NO
138
+ /* *
139
+ Compares the receiver to another FBSDKAccessToken
140
+ - Parameter token: The other token
141
+ - Returns: YES if the receiver's values are equal to the other token's values; otherwise NO
138
142
*/
139
143
- (BOOL )isEqualToAccessToken : (FBSDKAccessToken *)token ;
140
144
141
- /* !
142
- @abstract Returns the "global" access token that represents the currently logged in user.
143
- @discussion The `currentAccessToken` is a convenient representation of the token of the
145
+ /* *
146
+ Returns the "global" access token that represents the currently logged in user.
147
+
148
+ The `currentAccessToken` is a convenient representation of the token of the
144
149
current user and is used by other SDK components (like `FBSDKLoginManager`).
145
150
*/
146
151
+ (FBSDKAccessToken *)currentAccessToken ;
147
152
148
- /* !
149
- @abstract Sets the "global" access token that represents the currently logged in user.
150
- @param token The access token to set.
151
- @discussion This will broadcast a notification and save the token to the app keychain.
153
+ /* *
154
+ Sets the "global" access token that represents the currently logged in user.
155
+ - Parameter token: The access token to set.
156
+
157
+ This will broadcast a notification and save the token to the app keychain.
152
158
*/
153
159
+ (void )setCurrentAccessToken : (FBSDKAccessToken *)token ;
154
160
155
- /* !
156
- @abstract Refresh the current access token's permission state and extend the token's expiration date,
161
+ /* *
162
+ Refresh the current access token's permission state and extend the token's expiration date,
157
163
if possible.
158
- @param completionHandler an optional callback handler that can surface any errors related to permission refreshing.
159
- @discussion On a successful refresh, the currentAccessToken will be updated so you typically only need to
164
+ - Parameter completionHandler: an optional callback handler that can surface any errors related to permission refreshing.
165
+
166
+ On a successful refresh, the currentAccessToken will be updated so you typically only need to
160
167
observe the `FBSDKAccessTokenDidChangeNotification` notification.
161
168
162
169
If a token is already expired, it cannot be refreshed.
0 commit comments