Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings when integrating via CocoaPods #246

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion KeenClient.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |spec|
spec.name = 'KeenClient'
spec.version = '3.7.0'
spec.license = { :type => 'MIT' }
spec.ios.deployment_target = '6.0'
spec.ios.deployment_target = '8.0'
spec.osx.deployment_target = '10.9'
spec.homepage = 'https://github.com/keenlabs/KeenClient-iOS'

Expand All @@ -23,6 +23,9 @@ Pod::Spec.new do |spec|
spec.public_header_files = 'KeenClient/*.h'
spec.requires_arc = true
spec.frameworks = 'SystemConfiguration', 'CoreLocation', 'CFNetwork'
spec.pod_target_xcconfig = {
'CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF' => 'NO',
}

spec.subspec 'keen_sqlite' do |ks|
ks.source_files = 'Library/sqlite-amalgamation/*.{h,c}'
Expand Down
16 changes: 8 additions & 8 deletions KeenClient.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,6 @@
0111015814EF71FB009794A5 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand All @@ -899,7 +898,6 @@
0111015914EF71FB009794A5 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
};
Expand All @@ -909,6 +907,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
COPY_PHASE_STRIP = NO;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
Expand All @@ -923,7 +923,7 @@
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
Expand All @@ -933,13 +933,15 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
COPY_PHASE_STRIP = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_VERSION = "";
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
Expand All @@ -949,6 +951,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
DSTROOT = /tmp/KeenClient.dst;
GCC_GENERATE_TEST_COVERAGE_FILES = NO;
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO;
Expand All @@ -957,7 +960,6 @@
GCC_PREPROCESSOR_DEFINITIONS = "$(inherited)";
"GCC_PREPROCESSOR_DEFINITIONS[arch=*]" = "$(inherited)";
GCC_THUMB_SUPPORT = NO;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Library\"",
Expand All @@ -973,11 +975,11 @@
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
DSTROOT = /tmp/KeenClient.dst;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = "$(PROJECT_DIR)/KeenClient/KeenClient-Prefix.pch";
GCC_THUMB_SUPPORT = NO;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Library\"",
Expand Down Expand Up @@ -1076,7 +1078,6 @@
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1114,7 +1115,6 @@
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
2 changes: 1 addition & 1 deletion KeenClient/KIOUploader.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@
- (instancetype)initWithNetwork:(KIONetwork *)network andStore:(KIODBStore *)store;

// Upload events in the store for a given project
- (void)uploadEventsForConfig:(KeenClientConfig *)config completionHandler:(void (^)())completionHandler;
- (void)uploadEventsForConfig:(KeenClientConfig *)config completionHandler:(void (^)(void))completionHandler;

@end
6 changes: 3 additions & 3 deletions KeenClient/KIOUploader.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ @interface KIOUploader ()

- (BOOL)isNetworkConnected;

- (void)runUploadFinishedBlock:(void (^)())block;
- (void)runUploadFinishedBlock:(void (^)(void))block;

/**
Handles the HTTP response from the Keen Event API. This involves deserializing the JSON response
Expand Down Expand Up @@ -151,7 +151,7 @@ - (BOOL)isNetworkConnected {
return [hostReachability KIOcurrentReachabilityStatus] != NotReachable;
}

- (void)uploadEventsForConfig:(KeenClientConfig *)config completionHandler:(void (^)())completionHandler {
- (void)uploadEventsForConfig:(KeenClientConfig *)config completionHandler:(void (^)(void))completionHandler {
dispatch_async(self.uploadQueue, ^{
if (![self isNetworkConnected]) {
[self runUploadFinishedBlock:completionHandler];
Expand Down Expand Up @@ -207,7 +207,7 @@ - (void)uploadEventsForConfig:(KeenClientConfig *)config completionHandler:(void
});
}

- (void)runUploadFinishedBlock:(void (^)())block {
- (void)runUploadFinishedBlock:(void (^)(void))block {
if (block) {
KCLogVerbose(@"Running user-specified block.");
block();
Expand Down
2 changes: 1 addition & 1 deletion KeenClient/KeenClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ typedef void (^AnalysisCompletionBlock)(NSData *responseData, NSURLResponse *res
@param block The block to be executed once uploading is finished, regardless of whether or not the upload succeeded.
The block is also called when no upload was necessary because no events were captured.
*/
- (void)uploadWithFinishedBlock:(void (^)())block;
- (void)uploadWithFinishedBlock:(void (^)(void))block;

/**
Refresh the current geo location. The Keen Client only gets geo at the beginning of each session (i.e. when the client
Expand Down
8 changes: 4 additions & 4 deletions KeenClient/KeenClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ - (void)refreshCurrentLocation {
if ([KeenClient isLocationAuthorized:clAuthStatus]) {
[self startMonitoringLocation];
}
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
#if TARGET_OS_IPHONE
// Else, try and request permission for that.
else if (geoLocationRequestEnabled &&
[self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) {
Expand Down Expand Up @@ -378,8 +378,8 @@ + (BOOL)isLocationAuthorized:(CLAuthorizationStatus)status {

// Delegate method from the CLLocationManagerDelegate protocol.
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation {
didUpdateLocations:(NSArray<CLLocation *> *)locations {
CLLocation *newLocation = locations.lastObject;
// If it's a relatively recent event, turn off updates to save power
NSDate *eventDate = newLocation.timestamp;
NSTimeInterval howRecent = [eventDate timeIntervalSinceNow];
Expand Down Expand Up @@ -563,7 +563,7 @@ - (void)importFileData {
[KIOFileStore importFileDataWithProjectID:self.config.projectID];
}

- (void)uploadWithFinishedBlock:(void (^)())block {
- (void)uploadWithFinishedBlock:(void (^)(void))block {
[self.uploader uploadEventsForConfig:self.config completionHandler:block];
}

Expand Down