Skip to content

Commit 1a4754d

Browse files
committed
Prefix Reachability
1 parent e1d67b1 commit 1a4754d

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

Adjust/ADJReachability.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@
1212

1313

1414
typedef enum : NSInteger {
15-
NotReachable = 0,
16-
ReachableViaWiFi,
17-
ReachableViaWWAN
18-
} NetworkStatus;
15+
ADJNotReachable = 0,
16+
ADJReachableViaWiFi,
17+
ADJReachableViaWWAN
18+
} ADJNetworkStatus;
1919

2020
#pragma mark IPv6 Support
2121
//Reachability fully support IPv6. For full details, see ReadMe.md.
2222

2323

24-
extern NSString *kReachabilityChangedNotification;
24+
extern NSString *kADJReachabilityChangedNotification;
2525

2626

2727
@interface ADJReachability : NSObject
@@ -52,7 +52,7 @@ extern NSString *kReachabilityChangedNotification;
5252
- (BOOL)startNotifier;
5353
- (void)stopNotifier;
5454

55-
- (NetworkStatus)currentReachabilityStatus;
55+
- (ADJNetworkStatus)currentReachabilityStatus;
5656

5757
/*!
5858
* WWAN may be available, but not active until a connection has been established. WiFi may require a connection for VPN on Demand.

Adjust/ADJReachability.m

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#pragma mark IPv6 Support
1919

20-
NSString *kReachabilityChangedNotification = @"kNetworkReachabilityChangedNotification";
20+
NSString *kADJReachabilityChangedNotification = @"kNetworkReachabilityChangedNotification";
2121

2222
#pragma mark - Supporting functions
2323

@@ -52,7 +52,7 @@ static void ReachabilityCallback(SCNetworkReachabilityRef target, SCNetworkReach
5252

5353
ADJReachability* noteObject = (__bridge ADJReachability *)info;
5454
// Post a notification to notify the client that the network reachability changed.
55-
[[NSNotificationCenter defaultCenter] postNotificationName: kReachabilityChangedNotification object: noteObject];
55+
[[NSNotificationCenter defaultCenter] postNotificationName: kADJReachabilityChangedNotification object: noteObject];
5656
}
5757

5858

@@ -154,23 +154,23 @@ - (void)dealloc
154154

155155
#pragma mark - Network Flag Handling
156156

157-
- (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags
157+
- (ADJNetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags
158158
{
159159
PrintReachabilityFlags(flags, "networkStatusForFlags");
160160
if ((flags & kSCNetworkReachabilityFlagsReachable) == 0)
161161
{
162162
// The target host is not reachable.
163-
return NotReachable;
163+
return ADJNotReachable;
164164
}
165165

166-
NetworkStatus returnValue = NotReachable;
166+
ADJNetworkStatus returnValue = ADJNotReachable;
167167

168168
if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0)
169169
{
170170
/*
171171
If the target host is reachable and no connection is required then we'll assume (for now) that you're on Wi-Fi...
172172
*/
173-
returnValue = ReachableViaWiFi;
173+
returnValue = ADJReachableViaWiFi;
174174
}
175175

176176
if ((((flags & kSCNetworkReachabilityFlagsConnectionOnDemand ) != 0) ||
@@ -185,7 +185,7 @@ - (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags
185185
/*
186186
... and no [user] intervention is needed...
187187
*/
188-
returnValue = ReachableViaWiFi;
188+
returnValue = ADJReachableViaWiFi;
189189
}
190190
}
191191

@@ -194,7 +194,7 @@ - (NetworkStatus)networkStatusForFlags:(SCNetworkReachabilityFlags)flags
194194
/*
195195
... but WWAN connections are OK if the calling application is using the CFNetwork APIs.
196196
*/
197-
returnValue = ReachableViaWWAN;
197+
returnValue = ADJReachableViaWWAN;
198198
}
199199

200200
return returnValue;
@@ -215,10 +215,10 @@ - (BOOL)connectionRequired
215215
}
216216

217217

218-
- (NetworkStatus)currentReachabilityStatus
218+
- (ADJNetworkStatus)currentReachabilityStatus
219219
{
220220
NSAssert(_reachabilityRef != NULL, @"currentNetworkStatus called with NULL SCNetworkReachabilityRef");
221-
NetworkStatus returnValue = NotReachable;
221+
ADJNetworkStatus returnValue = ADJNotReachable;
222222
SCNetworkReachabilityFlags flags;
223223

224224
if (SCNetworkReachabilityGetFlags(_reachabilityRef, &flags))

0 commit comments

Comments
 (0)