forked from loafle/openapi-generator-original
Updates to iOS ApiClient - added getting for for offline state and settings for reachability status. This addresses "Default iOS reachability status #2422"
This commit is contained in:
@@ -53,6 +53,10 @@ static void (^reachabilityChangeBlock)(int);
|
||||
cacheEnabled = enabled;
|
||||
}
|
||||
|
||||
+(void) setReachabilityStatus:(AFNetworkReachabilityStatus)status {
|
||||
reachabilityStatus = status;
|
||||
}
|
||||
|
||||
- (void)setHeaderValue:(NSString*) value
|
||||
forKey:(NSString*) forKey {
|
||||
[self.requestSerializer setValue:value forHTTPHeaderField:forKey];
|
||||
@@ -238,6 +242,10 @@ static void (^reachabilityChangeBlock)(int);
|
||||
return reachabilityStatus;
|
||||
}
|
||||
|
||||
+(bool) getOfflineState {
|
||||
return offlineState;
|
||||
}
|
||||
|
||||
+(void) setReachabilityChangeBlock:(void(^)(int))changeBlock {
|
||||
reachabilityChangeBlock = changeBlock;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,20 @@ extern NSString *const {{classPrefix}}ResponseObjectErrorKey;
|
||||
*/
|
||||
+(void) setOfflineState:(BOOL) state;
|
||||
|
||||
/**
|
||||
* Gets if the client is unreachable
|
||||
*
|
||||
* @return The client offline state
|
||||
*/
|
||||
+(bool) getOfflineState;
|
||||
|
||||
/**
|
||||
* Sets the client reachability, this may be override by the reachability manager if reachability changes
|
||||
*
|
||||
* @param The client reachability.
|
||||
*/
|
||||
+(void) setReachabilityStatus:(AFNetworkReachabilityStatus) status;
|
||||
|
||||
/**
|
||||
* Gets the client reachability
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user