Skip to content

Commit

Permalink
Add local cached tags helper
Browse files Browse the repository at this point in the history
  • Loading branch information
svenroed committed Dec 20, 2016
1 parent 94a4ed1 commit 98e07e7
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 2 deletions.
35 changes: 35 additions & 0 deletions KatalysatorSDK.framework/Versions/A/Headers/KATAudienceManager.h
Expand Up @@ -17,6 +17,22 @@
typedef void(^KATAudienceHandler)(NSDictionary * _Nullable audiences, NSError * _Nullable error);


/**
* KATTagResponseFormat gives the option to retrieve the response tags in a specific format
*
*/
typedef NS_OPTIONS(NSUInteger, KATTagResponseFormat) {
/** The KATTagResponseFormatFlat returns the tag in a flat array
* @since v1.9.4
*/
KATTagResponseFormatFlat = 1,
/** The KATTagResponseFormatMap returns the tags in a dictionary format
* @since v1.9.4
*/
KATTagResponseFormatMap = 2,
};


@interface KATAudienceManager : NSObject


Expand Down Expand Up @@ -53,6 +69,15 @@ typedef void(^KATAudienceHandler)(NSDictionary * _Nullable audiences, NSError *
- (void)audiencesAndGeotagsWithCompletion:(KATAudienceHandler _Nullable)completion;


/**
* Get the latest local tags
*
* @return dictionary or array of tags containing list and mapped tags
* @since v1.9.4
*/
- (id _Nullable)cachedTags:(KATTagResponseFormat)format;


/**
* Allows adding additional data to a profile for creating audiences
*
Expand Down Expand Up @@ -97,4 +122,14 @@ typedef void(^KATAudienceHandler)(NSDictionary * _Nullable audiences, NSError *
*/
+ (NSString * _Nullable)toQueryString:(NSDictionary * _Nonnull)kv;


/**
* Utility method to check if headphones are conntected
*
* @return bool
* @since v1.9.3
*/
+ (BOOL)hasHeadphonesConnected;


@end
Binary file modified KatalysatorSDK.framework/Versions/A/KatalysatorSDK
Binary file not shown.
4 changes: 4 additions & 0 deletions Sample.xcodeproj/project.pbxproj
Expand Up @@ -19,6 +19,7 @@
3232B50B18246C51009E75E7 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3232B50A18246C51009E75E7 /* CoreLocation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
328A75601998FDCE00E99A50 /* AdSupport.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 328A755F1998FDCE00E99A50 /* AdSupport.framework */; };
32B648911A791A49007A63C7 /* KatalysatorSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32B648901A791A49007A63C7 /* KatalysatorSDK.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
32D8E9DA1E0955A200BD0F65 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32D8E9D91E0955A200BD0F65 /* AVFoundation.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
32E7FCD81BCBED860024FB94 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32E7FCD71BCBED860024FB94 /* CoreTelephony.framework */; };
32E7FCDA1BCBED910024FB94 /* CoreBluetooth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32E7FCD91BCBED910024FB94 /* CoreBluetooth.framework */; };
32E7FCE01BCBEE120024FB94 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 32E7FCDF1BCBEE120024FB94 /* SystemConfiguration.framework */; };
Expand All @@ -41,6 +42,7 @@
3232B50A18246C51009E75E7 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
328A755F1998FDCE00E99A50 /* AdSupport.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AdSupport.framework; path = System/Library/Frameworks/AdSupport.framework; sourceTree = SDKROOT; };
32B648901A791A49007A63C7 /* KatalysatorSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = KatalysatorSDK.framework; sourceTree = "<group>"; };
32D8E9D91E0955A200BD0F65 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
32E7FCD51BCBED6C0024FB94 /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
32E7FCD71BCBED860024FB94 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
32E7FCD91BCBED910024FB94 /* CoreBluetooth.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreBluetooth.framework; path = System/Library/Frameworks/CoreBluetooth.framework; sourceTree = SDKROOT; };
Expand All @@ -53,6 +55,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
32D8E9DA1E0955A200BD0F65 /* AVFoundation.framework in Frameworks */,
32E7FCE01BCBEE120024FB94 /* SystemConfiguration.framework in Frameworks */,
32E7FCDA1BCBED910024FB94 /* CoreBluetooth.framework in Frameworks */,
32E7FCD81BCBED860024FB94 /* CoreTelephony.framework in Frameworks */,
Expand Down Expand Up @@ -88,6 +91,7 @@
3232B4D418246C47009E75E7 /* Frameworks */ = {
isa = PBXGroup;
children = (
32D8E9D91E0955A200BD0F65 /* AVFoundation.framework */,
32E7FCDF1BCBEE120024FB94 /* SystemConfiguration.framework */,
32E7FCDD1BCBEDEC0024FB94 /* MobileCoreServices.framework */,
32E7FCD91BCBED910024FB94 /* CoreBluetooth.framework */,
Expand Down
5 changes: 4 additions & 1 deletion Sample/AppDelegate.m
Expand Up @@ -36,8 +36,11 @@ - (void)applicationDidBecomeActive:(UIApplication *)application
NSUUID *apiToken = [[NSUUID alloc] initWithUUIDString:GLIMR_API_TOKEN];

KATAudienceManager *audienceManager = [[KATAudienceManager alloc] initWithApiToken:apiToken];

NSLog(@"Cached tags %@", [audienceManager cachedTags:KATTagResponseFormatFlat]);

[audienceManager audiencesAndGeotagsWithCompletion:^(NSDictionary *audiences, NSError *error) {
NSLog(@"AUDIENCES %@", audiences);
NSLog(@"Tags %@", audiences);
}];
}

Expand Down
2 changes: 1 addition & 1 deletion Sample/Sample-Info.plist
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.9.2</string>
<string>1.9.4</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit 98e07e7

Please sign in to comment.