Skip to content

Commit

Permalink
#118 Files Added
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek9634 committed Dec 2, 2015
1 parent a6d1653 commit 69a8768
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 63 deletions.
15 changes: 15 additions & 0 deletions sample-with-framework/Applozic/ALDataNetworkConnection.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// ALDataNetworkConnection.h
// Applozic
//
// Created by devashish on 02/12/2015.
// Copyright © 2015 applozic Inc. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ALDataNetworkConnection : UIViewController

+(BOOL)checkDataNetworkAvailable;

@end
42 changes: 42 additions & 0 deletions sample-with-framework/Applozic/ALDataNetworkConnection.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// ALDataNetworkConnection.m
// Applozic
//
// Created by devashish on 02/12/2015.
// Copyright © 2015 applozic Inc. All rights reserved.
//

#import "ALDataNetworkConnection.h"
#import <SystemConfiguration/SCNetworkReachability.h>

@interface ALDataNetworkConnection ()

@end

@implementation ALDataNetworkConnection

+(BOOL)checkDataNetworkAvailable
{
SCNetworkReachabilityFlags flags;
SCNetworkReachabilityRef address;
address = SCNetworkReachabilityCreateWithName(NULL, "www.google.com" );
Boolean success = SCNetworkReachabilityGetFlags(address, &flags);
CFRelease(address);

bool canReach = success
&& !(flags & kSCNetworkReachabilityFlagsConnectionRequired)
&& (flags & kSCNetworkReachabilityFlagsReachable);

if(canReach)
{
NSLog(@"NETWORK AVAILABLE");
}
else
{
NSLog(@"NETWORK ISN'T AVAILABLE");
}

return canReach;
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@
6D95476C1BE38DFF00776652 /* ALContactService.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D9547661BE38DFF00776652 /* ALContactService.m */; };
6D95476D1BE38DFF00776652 /* ALUITextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D9547671BE38DFF00776652 /* ALUITextView.h */; settings = {ATTRIBUTES = (Public, ); }; };
6D95476E1BE38DFF00776652 /* ALUITextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6D9547681BE38DFF00776652 /* ALUITextView.m */; };
6DB665071C0EE5EC004D04A8 /* ALDataNetworkConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 6DB665051C0EE5EC004D04A8 /* ALDataNetworkConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
6DB665081C0EE5EC004D04A8 /* ALDataNetworkConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 6DB665061C0EE5EC004D04A8 /* ALDataNetworkConnection.m */; };
982F13041C05D6050024678E /* MQTTClient-Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = 982F12F41C05D6040024678E /* MQTTClient-Prefix.pch */; };
982F13051C05D6050024678E /* MQTTClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 982F12F51C05D6040024678E /* MQTTClient.h */; };
982F13061C05D6050024678E /* MQTTDecoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 982F12F61C05D6040024678E /* MQTTDecoder.h */; };
Expand Down Expand Up @@ -385,6 +387,8 @@
6D9547661BE38DFF00776652 /* ALContactService.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ALContactService.m; path = Applozic/ALContactService.m; sourceTree = "<group>"; };
6D9547671BE38DFF00776652 /* ALUITextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ALUITextView.h; path = Applozic/ALUITextView.h; sourceTree = "<group>"; };
6D9547681BE38DFF00776652 /* ALUITextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ALUITextView.m; path = Applozic/ALUITextView.m; sourceTree = "<group>"; };
6DB665051C0EE5EC004D04A8 /* ALDataNetworkConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ALDataNetworkConnection.h; sourceTree = "<group>"; };
6DB665061C0EE5EC004D04A8 /* ALDataNetworkConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ALDataNetworkConnection.m; sourceTree = "<group>"; };
982F12F41C05D6040024678E /* MQTTClient-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "MQTTClient-Prefix.pch"; path = "Applozic/MQTT/MQTTClient-Prefix.pch"; sourceTree = "<group>"; };
982F12F51C05D6040024678E /* MQTTClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MQTTClient.h; path = Applozic/MQTT/MQTTClient.h; sourceTree = "<group>"; };
982F12F61C05D6040024678E /* MQTTDecoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MQTTDecoder.h; path = Applozic/MQTT/MQTTDecoder.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -788,6 +792,8 @@
6D6DF09A1BC5364C00EBA00F /* ALResponseHandler.m */,
6D6DF08E1BC5364C00EBA00F /* ALConnection.m */,
6D6DF08D1BC5364C00EBA00F /* ALConnection.h */,
6DB665051C0EE5EC004D04A8 /* ALDataNetworkConnection.h */,
6DB665061C0EE5EC004D04A8 /* ALDataNetworkConnection.m */,
);
name = networkcommunication;
sourceTree = "<group>";
Expand Down Expand Up @@ -876,6 +882,7 @@
6D6DF1721BC5364C00EBA00F /* ALFileMetaInfo.h in Headers */,
6D6DF1661BC5364C00EBA00F /* ALNotificationView.h in Headers */,
6D6DF1801BC5364C00EBA00F /* DB_CONTACT.h in Headers */,
6DB665071C0EE5EC004D04A8 /* ALDataNetworkConnection.h in Headers */,
6D6DF1601BC5364C00EBA00F /* ALChatCell_Image.h in Headers */,
6D7B95B51C06E09300374346 /* ALUserDetail.h in Headers */,
6D6DF13E1BC5364C00EBA00F /* ALConnection.h in Headers */,
Expand Down Expand Up @@ -1112,6 +1119,7 @@
6D6DF14F1BC5364C00EBA00F /* ALMessageService.m in Sources */,
6D6DF1551BC5364C00EBA00F /* UIImage+Utility.m in Sources */,
6D46B6C61BD025060014A5D3 /* ALMapViewController.m in Sources */,
6DB665081C0EE5EC004D04A8 /* ALDataNetworkConnection.m in Sources */,
6D6DF1531BC5364C00EBA00F /* ALUtilityClass.m in Sources */,
6D95476C1BE38DFF00776652 /* ALContactService.m in Sources */,
982F13131C05D6050024678E /* MQTTSSLSecurityPolicy.m in Sources */,
Expand Down
1 change: 1 addition & 0 deletions sample-with-framework/Applozic/Applozic/Applozic.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ FOUNDATION_EXPORT const unsigned char ApplozicVersionString[];
#import <Applozic/ALApplozicSettings.h>
#import <Applozic/UIImage+Utility.h>
#import <Applozic/ALUserDetail.h>
#import <Applozic/ALDataNetworkConnection.h>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#import <Applozic/ALRegisterUserClientService.h>
#import <Applozic/ALMessagesViewController.h>
#import <Applozic/ALApplozicSettings.h>
#import <Applozic/ALDataNetworkConnection.h>

@interface ApplozicLoginViewController ()

Expand Down Expand Up @@ -54,6 +55,8 @@ - (void)viewWillAppear:(BOOL)animated {

[self registerForKeyboardNotifications];

[ALDataNetworkConnection checkDataNetworkAvailable];

}

- (void)viewWillDisappear:(BOOL)animated {
Expand Down
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

0 comments on commit 69a8768

Please sign in to comment.