commit | author | age
|
a0a843
|
1 |
// |
H |
2 |
// TWTRConstants.h |
|
3 |
// |
|
4 |
// Copyright (c) 2015 Twitter. All rights reserved. |
|
5 |
// |
|
6 |
|
|
7 |
#import <Foundation/Foundation.h> |
|
8 |
|
|
9 |
NS_ASSUME_NONNULL_BEGIN |
|
10 |
|
|
11 |
/** |
|
12 |
* The NSError domain of errors surfaced by the Twitter SDK. |
|
13 |
*/ |
|
14 |
FOUNDATION_EXPORT NSString *const TWTRErrorDomain; |
|
15 |
|
|
16 |
/** |
|
17 |
* Error codes surfaced by the Twitter SDK. |
|
18 |
*/ |
|
19 |
typedef NS_ENUM(NSInteger, TWTRErrorCode) { |
|
20 |
|
|
21 |
/** |
|
22 |
* Unknown error. |
|
23 |
*/ |
|
24 |
TWTRErrorCodeUnknown = -1, |
|
25 |
|
|
26 |
/** |
|
27 |
* Authentication has not been set up yet. You must call -[Twitter logInWithCompletion:] or -[Twitter logInGuestWithCompletion:] |
|
28 |
*/ |
|
29 |
TWTRErrorCodeNoAuthentication = 0, |
|
30 |
|
|
31 |
/** |
|
32 |
* Twitter has not been initialized yet. Call +[Fabric with:@[TwitterKit]] or -[Twitter startWithConsumerKey:consumerSecret:]. |
|
33 |
*/ |
|
34 |
TWTRErrorCodeNotInitialized = 1, |
|
35 |
|
|
36 |
/** |
|
37 |
* User has declined to grant permission to information such as their email address. |
|
38 |
*/ |
|
39 |
TWTRErrorCodeUserDeclinedPermission = 2, |
|
40 |
|
|
41 |
/** |
|
42 |
* User has granted permission to their email address but no address is associated with their account. |
|
43 |
*/ |
|
44 |
TWTRErrorCodeUserHasNoEmailAddress = 3, |
|
45 |
|
|
46 |
/** |
|
47 |
* A resource has been requested by ID, but that ID was not found. |
|
48 |
*/ |
|
49 |
TWTRErrorCodeInvalidResourceID = 4, |
|
50 |
|
|
51 |
/** |
|
52 |
* A request has been issued for an invalid URL. |
|
53 |
*/ |
|
54 |
TWTRErrorCodeInvalidURL = 5, |
|
55 |
|
|
56 |
/** |
|
57 |
* Type mismatch in parsing JSON from the Twitter API. |
|
58 |
*/ |
|
59 |
TWTRErrorCodeMismatchedJSONType = 6, |
|
60 |
|
|
61 |
/** |
|
62 |
* Fail to save to keychain. |
|
63 |
*/ |
|
64 |
TWTRErrorCodeKeychainSerializationFailure = 7, |
|
65 |
|
|
66 |
/** |
|
67 |
* Fail to save to disk. |
|
68 |
*/ |
|
69 |
TWTRErrorCodeDiskSerializationError = 8, |
|
70 |
|
|
71 |
/** |
|
72 |
* Error authenticating with the webview. |
|
73 |
*/ |
|
74 |
TWTRErrorCodeWebViewError = 9, |
|
75 |
|
|
76 |
/** |
|
77 |
* A required parameter is missing. |
|
78 |
*/ |
|
79 |
TWTRErrorCodeMissingParameter = 10 |
|
80 |
}; |
|
81 |
|
|
82 |
/** |
|
83 |
* The NSError domain of errors surfaced by the Twitter SDK during the login operation. |
|
84 |
*/ |
|
85 |
FOUNDATION_EXPORT NSString *const TWTRLogInErrorDomain; |
|
86 |
|
|
87 |
/** |
|
88 |
* Error codes surfaced by the Twitter SDK with the `TWTRLogInErrorDomain` error domain. |
|
89 |
*/ |
|
90 |
typedef NS_ENUM(NSInteger, TWTRLogInErrorCode) { |
|
91 |
|
|
92 |
/** |
|
93 |
* Unknown error. |
|
94 |
*/ |
|
95 |
TWTRLogInErrorCodeUnknown = -1, |
|
96 |
|
|
97 |
/** |
|
98 |
* User denied login. |
|
99 |
*/ |
|
100 |
TWTRLogInErrorCodeDenied = 0, |
|
101 |
|
|
102 |
/** |
|
103 |
* User canceled login. |
|
104 |
*/ |
|
105 |
TWTRLogInErrorCodeCancelled = 1, |
|
106 |
|
|
107 |
/** |
|
108 |
* No Twitter account found. |
|
109 |
*/ |
|
110 |
TWTRLogInErrorCodeNoAccounts = 2, |
|
111 |
|
|
112 |
/** |
|
113 |
* Reverse auth with linked account failed. |
|
114 |
*/ |
|
115 |
TWTRLogInErrorCodeReverseAuthFailed = 3, |
|
116 |
|
|
117 |
/** |
|
118 |
* Refreshing session tokens failed. |
|
119 |
*/ |
|
120 |
TWTRLogInErrorCodeCannotRefreshSession = 4, |
|
121 |
|
|
122 |
/** |
|
123 |
* No such session or session is not tracked |
|
124 |
* in the associated session store. |
|
125 |
*/ |
|
126 |
TWTRLogInErrorCodeSessionNotFound = 5, |
|
127 |
|
|
128 |
/** |
|
129 |
* The login request failed. |
|
130 |
*/ |
|
131 |
TWTRLogInErrorCodeFailed = 6, |
|
132 |
|
|
133 |
/** |
|
134 |
* The system account credentials are no longer valid and the |
|
135 |
* user will need to update their credentials in the Settings app. |
|
136 |
*/ |
|
137 |
TWTRLogInErrorCodeSystemAccountCredentialsInvalid = 7, |
|
138 |
|
|
139 |
/** |
|
140 |
* There was no Twitter iOS app installed to attemp |
|
141 |
* the Mobile SSO flow. |
|
142 |
*/ |
|
143 |
TWTRLoginErrorNoTwitterApp = 8, |
|
144 |
}; |
|
145 |
|
|
146 |
NS_ASSUME_NONNULL_END |