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