Permalink
Browse files

Initial commit.

  • Loading branch information...
0 parents commit 04ea16182594eb8c60849cb8211fe0fcbd6d7210 @iHasApp iHasApp committed Jun 26, 2012
Showing with 2,574 additions and 0 deletions.
  1. +4 −0 .gitignore
  2. +40 −0 README.md
  3. +1 −0 iHasApp.framework/Headers
  4. +1 −0 iHasApp.framework/Resources
  5. +120 −0 iHasApp.framework/Versions/A/Headers/iHasApp.h
  6. BIN iHasApp.framework/Versions/A/Resources/Info.plist
  7. BIN iHasApp.framework/Versions/A/Resources/InfoPlist.strings
  8. BIN iHasApp.framework/Versions/A/Resources/iHasApp-Info.plist
  9. BIN iHasApp.framework/Versions/A/iHasApp
  10. +1 −0 iHasApp.framework/Versions/Current
  11. +1 −0 iHasApp.framework/iHasApp
  12. +356 −0 iHasAppExample/iHasAppExample.xcodeproj/project.pbxproj
  13. +7 −0 iHasAppExample/iHasAppExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  14. BIN ....xcodeproj/project.xcworkspace/xcuserdata/danielamitay.xcuserdatad/UserInterfaceState.xcuserstate
  15. +85 −0 ...le/iHasAppExample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcschemes/iHasAppExample.xcscheme
  16. +22 −0 ...e/iHasAppExample.xcodeproj/xcuserdata/danielamitay.xcuserdatad/xcschemes/xcschememanagement.plist
  17. +19 −0 iHasAppExample/iHasAppExample/AppDelegate.h
  18. +50 −0 iHasAppExample/iHasAppExample/AppDelegate.m
  19. +15 −0 iHasAppExample/iHasAppExample/DetailViewController.h
  20. +146 −0 iHasAppExample/iHasAppExample/DetailViewController.m
  21. +17 −0 iHasAppExample/iHasAppExample/MasterViewController.h
  22. +196 −0 iHasAppExample/iHasAppExample/MasterViewController.m
  23. +32 −0 iHasAppExample/iHasAppExample/SDWebImage/SDImageCache.h
  24. +340 −0 iHasAppExample/iHasAppExample/SDWebImage/SDImageCache.m
  25. +19 −0 iHasAppExample/iHasAppExample/SDWebImage/SDImageCacheDelegate.h
  26. +21 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImageCompat.h
  27. +36 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImageDecoder.h
  28. +124 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImageDecoder.m
  29. +42 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImageDownloader.h
  30. +174 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImageDownloader.m
  31. +21 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImageDownloaderDelegate.h
  32. +39 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImageManager.h
  33. +290 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImageManager.m
  34. +19 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImageManagerDelegate.h
  35. +44 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImagePrefetcher.h
  36. +112 −0 iHasAppExample/iHasAppExample/SDWebImage/SDWebImagePrefetcher.m
  37. +52 −0 iHasAppExample/iHasAppExample/SDWebImage/UIImageView+WebCache.h
  38. +48 −0 iHasAppExample/iHasAppExample/SDWebImage/UIImageView+WebCache.m
  39. BIN iHasAppExample/iHasAppExample/SDWebImage/placeholder-icon.png
  40. +2 −0 iHasAppExample/iHasAppExample/en.lproj/InfoPlist.strings
  41. +45 −0 iHasAppExample/iHasAppExample/iHasAppExample-Info.plist
  42. +14 −0 iHasAppExample/iHasAppExample/iHasAppExample-Prefix.pch
  43. +19 −0 iHasAppExample/iHasAppExample/main.m
@@ -0,0 +1,4 @@
+
+iHasApp.framework/.DS_Store
+
+.DS_Store
@@ -0,0 +1,40 @@
+iHasApp Framework
+=========================
+
+The iHasApp iOS Framework allows you to detect installed apps on a user's device.
+
+Basic Setup
+-----------
+
+1. Sign up for a free account on [iHasApp.com](https://www.ihasapp.com) to receive your api key.
+
+2. Add iHasApp.framework to your project and ensure that it is linked to the project target.
+
+3. Add `#import <iHasApp/iHasApp.h>` to the files in which you wish to access iHasApp.
+
+4. Initialize and configure the iHasApp object.
+
+App Store Safe
+--------------
+
+The iHasApp framework utilizes only public, documented, and non-deprecated APIs. It is completely App Store safe.
+There are already a number of approved apps on the App Store that have integrated iHasApp.
+
+Like all things, it is always a prudent idea to either ask your users' permission or to include a clause in your EULA.
+
+Example Application
+--------------
+
+This framework comes with a demo application that demonstrates initialization, country configuration (automatically grabbing the device's current locale), delegate methods, and information display. You will need to insert your own API key in the '-viewDidLoad' section of 'MasterViewController.m'.
+
+The iHasAppExample project uses Olivier Poitrey's [SDWebImage](https://github.com/rs/SDWebImage) project to asynchronously display the app icons.
+
+Documentation
+--------------
+
+The 'iHasApp.h' header file is structurally commented. If you would like to see the Appledoc representation, visit the [iHasApp Documentation](https://www.ihasapp.com/documentation).
+
+Troubleshooting
+--------------
+
+Feel free to contact me at daniel@ihasapp.com
@@ -0,0 +1,120 @@
+//
+// iHasApp.h
+// iHasApp
+//
+// Created by Daniel Amitay on 4/30/12.
+// Copyright (c) 2012 Objective-See, LLC. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+
+typedef enum {
+ iHasAppErrorConnection = 0,
+ iHasAppErrorInvalidKey = 1,
+ iHasAppErrorReachedLimit = 2,
+ iHasAppErrorUnknown = 3
+} iHasAppError;
+
+
+/** The iHasAppDelegate protocol describes the interface iHasApp delegates should adopt to respond to app detection events.
+ */
+@protocol iHasAppDelegate <NSObject>
+
+@optional
+
+/** Sent to the delegate when the app detection has successfully completed.
+
+ @param allApps An array containing NSDictionaries of the iHasApp object's most recently detected apps. Equivalent to calling -detectedApps on the iHasApp object.
+ @see appDetectionDidSucceed:
+ */
+- (void)appDetectionDidSucceed:(NSArray *)allApps;
+
+/** Sent to the delegate when the app detection has unsuccessfully terminated.
+
+ @param detectionError Contains an error enum describing the problem.
+ @see appDetectionDidSucceed:
+ */
+- (void)appDetectionDidFail:(iHasAppError)detectionError;
+
+@end
+
+
+/** The `iHasApp` class is used to perform on-device app detection.
+
+ You will need to register for a free account at https://www.ihasapp.com to obtain a valid API key.
+ */
+@interface iHasApp : NSObject
+
+/**---------------------------------------------------------------------------------------
+ * @name Properties
+ * ---------------------------------------------------------------------------------------
+ */
+
+/** The API key from your https://www.ihasapp.com account dashboard. An incorrect API key will result in a failed app detection. Default is nil.
+ */
+@property (nonatomic, strong) NSString *APIKey;
+
+/** The delegate object to receive detection events.
+ */
+@property (nonatomic, assign) NSObject<iHasAppDelegate> *delegate;
+
+/** The two-letter country code for the store you want to search. The search uses the default store front for the specified country. Default is US.
+
+ See http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 for a list of ISO Country Codes.
+
+ //To determine device-specific country codes, use:
+ NSString *countryCode = [[NSLocale currentLocale] objectForKey:NSLocaleCountryCode];
+
+ */
+@property (nonatomic, strong) NSString *country;
+
+/**---------------------------------------------------------------------------------------
+ * @name Starting the Detection
+ * ---------------------------------------------------------------------------------------
+ */
+
+/** Initializes and returns the iHasApp object with the specified delegate and APIKey.
+
+ @param delegate The object to receive the delegate callbacks.
+ @param key The API key from your https://www.ihasapp.com account dashboard.
+ @return An initialized iHasApp object.
+ */
+- (iHasApp *)initWithDelegate:(id<iHasAppDelegate>)delegate andKey:(NSString *)key;
+
+
+/** Starts the app detection process.
+ */
+- (void)beginDetection;
+
+/**---------------------------------------------------------------------------------------
+ * @name Informational
+ * ---------------------------------------------------------------------------------------
+ */
+
+/** Returns an array containing NSDictionaries of the most recently detected apps.
+
+ @return An array containing NSDictionaries of the iHasApp object's most recently detected apps, or nil if the detection is incomplete or unsuccessful. The order of the dictionaries in the array is not defined.
+
+ The dictionaries are the same as the results returned from an iTunes Search API request. See the "results" of the following api response for an example: http://itunes.apple.com/lookup?id=284882215
+
+ @see appIds
+ */
+- (NSArray *)detectedApps;
+
+
+/** Returns an array containing NSStrings of the most recently detected app ids (referred to as 'trackId' in iTunes dictionaries).
+
+ @return An array containing NSStrings of the iHasApp object's most recently detected app ids, or nil if the detection is incomplete or unsuccessful. The order of the strings in the array is not defined.
+ @see detectedApps
+ */
+- (NSArray *)appIds;
+
+
+/** Returns the iHasApp framework version string.
+
+ @return An NSString representation of the iHasApp framework version.
+ */
+- (NSString *)version;
+
+
+@end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.

0 comments on commit 04ea161

Please sign in to comment.