32 lines
934 B
Objective-C
32 lines
934 B
Objective-C
//
|
|
// ServerRequest.h
|
|
// Earthquake Network
|
|
//
|
|
// Refactored by Andrea Busi on 25/09/2020.
|
|
// Copyright © 2020 Earthquake Network. All rights reserved.
|
|
//
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import <UIKit/UIKit.h>
|
|
#import "Costanti.h"
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
typedef void (^successCompletionHandler)(id _Nullable result);
|
|
typedef void (^errorCompletionHandler)(NSError * _Nullable error);
|
|
|
|
@interface ServerRequest : NSObject <NSURLSessionDelegate, NSURLSessionTaskDelegate>
|
|
|
|
@property (nonatomic) BOOL isConnect;
|
|
|
|
|
|
+ (instancetype)defaultServerConnectionSingleton NS_SWIFT_NAME(default());
|
|
|
|
- (void)inviaInformazioniAlServerWithURL:(NSURL *)url richiesta:(EQNTipoChiamata)chiamata success:(successCompletionHandler)onSuccess failure:(errorCompletionHandler)onFailure;
|
|
|
|
- (void)inviaRicevuta:(NSData *)ricevuta success:(successCompletionHandler)onSuccess failure:(errorCompletionHandler)onFailure;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|