#import <Foundation/Foundation.h>
#import "AFHTTPSessionManager.h"
@interface Afappdotnetapiclient:Afhttpsessionmanager
+ (instancetype) sharedclient;
@end
#import "AFAppDotNetAPIClient.h"
Static nsstring * const afappdotnetapibaseurlstring =@ "https://api.app.net/";
@implementation Afappdotnetapiclient
+ (instancetype) sharedclient {
Static afappdotnetapiclient *_sharedclient =nil;
Static dispatch_once_t Oncetoken;
dispatch_once (&oncetoken, ^{
_sharedclient = [[ afappdotnetapiclient alloc ] initwithbaseurl :[ nsurl urlwithstring : Afappdotnetapibaseurlstring
_sharedclient. securitypolicy = [afsecuritypolicypolicywithpinningmode:afsslpinningmodenone];
[_sharedclient. Reachabilitymanagersetreachabilitystatuschangeblock: ^ (afnetworkreachabilitystatus status) {
Switch (status) {
caseAfnetworkreachabilitystatusreachableviawwan:
NSLog(@ "-------afnetworkreachabilitystatusreachableviawwan------");
break;
caseafnetworkreachabilitystatusreachableviawifi:
NSLog(@ "-------afnetworkreachabilitystatusreachableviawifi------");
break;
caseafnetworkreachabilitystatusnotreachable:
NSLog(@ "-------afnetworkreachabilitystatusnotreachable------");
break;
default:
break;
}
}];
[_sharedclient. Reachabilitymanager startmonitoring];
});
return _sharedclient;
}
@end
Afnetworking Monitoring Network changes