Skip to content

Commit

Permalink
- Resolve a few CocoaPods linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
justindhill committed Jul 1, 2016
1 parent db5c8d4 commit 1441c80
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Analytics/Classes/Internal/SEGLocation.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
@property (nonatomic, copy, readonly) NSDictionary *addressDictionary;
@property (nonatomic, assign, readonly) BOOL hasKnownLocation;


#if TARGET_OS_IOS || (TARGET_OS_MAC && !TARGET_OS_IPHONE)
- (void)startUpdatingLocation;
#endif

@end
6 changes: 5 additions & 1 deletion Analytics/Classes/Internal/SEGSegmentIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,11 @@ - (NSDictionary *)liveContext
});

self.location = !self.location ? [self.configuration shouldUseLocationServices] ? [SEGLocation new] : nil : self.location;

#if TARGET_OS_IOS || (TARGET_OS_MAC && !TARGET_OS_IPHONE)
[self.location startUpdatingLocation];
#endif

if (self.location.hasKnownLocation)
context[@"location"] = self.location.locationDictionary;

Expand Down Expand Up @@ -660,11 +664,11 @@ - (NSString *)getAnonymousId:(BOOL)reset
// We've chosen to generate a UUID rather than use the UDID (deprecated in iOS 5),
// identifierForVendor (iOS6 and later, can't be changed on logout),
// or MAC address (blocked in iOS 7). For more info see https://segment.io/libraries/ios#ids
NSURL *url = self.anonymousIDURL;

#if TARGET_OS_TV
NSString *anonymousId = [[NSUserDefaults standardUserDefaults] valueForKey:SEGAnonymousIdKey];
#else
NSURL *url = self.anonymousIDURL;
NSString *anonymousId = [[NSString alloc] initWithContentsOfURL:url encoding:NSUTF8StringEncoding error:NULL];
#endif

Expand Down
4 changes: 4 additions & 0 deletions Analytics/Classes/SEGAnalytics.m
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,17 @@ - (instancetype)initWithConfiguration:(SEGAnalyticsConfiguration *)configuration
if (configuration.trackInAppPurchases) {
_storeKitTracker = [SEGStoreKitTracker trackTransactionsForAnalytics:self];
}

[self trackApplicationLifecycleEvents:configuration.trackApplicationLifecycleEvents];

#if !TARGET_OS_TV
if (configuration.trackPushNotifications && configuration.launchOptions) {
NSDictionary *remoteNotification = configuration.launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey];
if (remoteNotification) {
[self trackPushNotification:remoteNotification fromLaunch:YES];
}
}
#endif
}
return self;
}
Expand Down

0 comments on commit 1441c80

Please sign in to comment.