Skip to content

Commit

Permalink
Fixed watchkit target compile fail
Browse files Browse the repository at this point in the history
  • Loading branch information
erkanyildiz committed Jul 2, 2015
1 parent 220267f commit 93b7dd9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions Countly.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Please visit www.count.ly for more information.

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@class CountlyEventQueue;

Expand Down
9 changes: 8 additions & 1 deletion CountlyDB.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
# ifndef COUNTLY_APP_GROUP_ID
# error "Application Group Identifier not specified! Please uncomment the line above and specify it."
# endif
#import <WatchKit/WatchKit.h>
#endif

/*
Expand Down Expand Up @@ -83,7 +84,13 @@ -(void)addToQueue:(NSString*)postData
NSString* watchSegmentationKey = @"[CLY]_apple_watch";
NSString* watchModel = (WKInterfaceDevice.currentDevice.screenBounds.size.width == 136.0)?@"38mm":@"42mm";
NSString* segmentation = [NSString stringWithFormat:@"{\"%@\":\"%@\"}", watchSegmentationKey, watchModel];
postData = [postData stringByAppendingFormat:@"&segment=%@", CountlyURLEscapedString(segmentation)];
NSString* escapedSegmentation = (NSString*)CFBridgingRelease(
CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
(CFStringRef)segmentation,
NULL,
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8));
postData = [postData stringByAppendingFormat:@"&segment=%@", escapedSegmentation];
#endif

[newManagedObject setValue:postData forKey:@"post"];
Expand Down

0 comments on commit 93b7dd9

Please sign in to comment.