File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
iOS_SDK/OneSignalSDK/OneSignalCore/Source/API Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 2929
3030// NS_ASSUME_NONNULL_BEGIN
3131
32+ typedef NS_ENUM (NSInteger , OSResponseStatusType) {
33+ OSResponseStatusInvalid = 0 ,
34+ OSResponseStatusRetryable,
35+ OSResponseStatusUnauthorized,
36+ OSResponseStatusMissing,
37+ OSResponseStatusConflict
38+ };
39+
3240@interface OSNetworkingUtils : NSObject
3341
3442+ (NSNumber *)getNetType ;
43+ + (OSResponseStatusType)getResponseStatusType : (NSInteger )statusCode ;
3544
3645@end
3746
Original file line number Diff line number Diff line change @@ -38,4 +38,18 @@ + (NSNumber *)getNetType {
3838 return @1 ;
3939}
4040
41+ + (OSResponseStatusType)getResponseStatusType : (NSInteger )statusCode {
42+ if (statusCode == 400 || statusCode == 402 ) {
43+ return OSResponseStatusInvalid;
44+ } else if (statusCode == 401 || statusCode == 403 ) {
45+ return OSResponseStatusUnauthorized;
46+ } else if (statusCode == 404 || statusCode == 410 ) {
47+ return OSResponseStatusMissing;
48+ } else if (statusCode == 409 ) {
49+ return OSResponseStatusConflict;
50+ } else {
51+ return OSResponseStatusRetryable;
52+ }
53+ }
54+
4155@end
You can’t perform that action at this time.
0 commit comments