Proyectos de Subversion Iphone Microlearning

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
// Copyright 2019 Google
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
//      http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
 
15
#import <Foundation/Foundation.h>
16
 
17
OBJC_EXTERN const NSUInteger FIRCLSNetworkMaximumRetryCount;
18
 
19
NS_ASSUME_NONNULL_BEGIN
20
 
21
typedef void (^FIRCLSNetworkDataTaskCompletionHandlerBlock)(NSData *__nullable data,
22
                                                            NSURLResponse *__nullable response,
23
                                                            NSError *__nullable error);
24
typedef void (^FIRCLSNetworkDownloadTaskCompletionHandlerBlock)(NSURL *__nullable location,
25
                                                                NSURLResponse *__nullable response,
26
                                                                NSError *__nullable error);
27
 
28
@interface FIRCLSFABNetworkClient : NSObject
29
 
30
- (instancetype)init;
31
- (instancetype)initWithQueue:(nullable NSOperationQueue *)operationQueue;
32
- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)config
33
                                       queue:(nullable NSOperationQueue *)operationQueue
34
    NS_DESIGNATED_INITIALIZER;
35
 
36
- (void)startDataTaskWithRequest:(NSURLRequest *)request
37
                      retryLimit:(NSUInteger)retryLimit
38
               completionHandler:(FIRCLSNetworkDataTaskCompletionHandlerBlock)completionHandler;
39
- (void)startDownloadTaskWithRequest:(NSURLRequest *)request
40
                          retryLimit:(NSUInteger)retryLimit
41
                   completionHandler:
42
                       (FIRCLSNetworkDownloadTaskCompletionHandlerBlock)completionHandler;
43
 
44
- (void)invalidateAndCancel;
45
 
46
// Backwards compatibility (we cannot change an interface in Fabric Base that other kits rely on,
47
// since we have no control of versioning dependencies)
48
- (void)startDataTaskWithRequest:(NSURLRequest *)request
49
               completionHandler:(FIRCLSNetworkDataTaskCompletionHandlerBlock)completionHandler;
50
- (void)startDownloadTaskWithRequest:(NSURLRequest *)request
51
                   completionHandler:
52
                       (FIRCLSNetworkDownloadTaskCompletionHandlerBlock)completionHandler;
53
 
54
@end
55
 
56
NS_ASSUME_NONNULL_END