diff --git a/#manifest# b/#manifest# new file mode 100644 index 0000000..a0a1489 --- /dev/null +++ b/#manifest# @@ -0,0 +1,18 @@ +# +# this is your module manifest and used by Titanium +# during compilation, packaging, distribution, etc. +# +version: 0.1 +apiversion: 2 +description: Implements iBeacon interface as in https\://github.com/nicHiBeacons +author: Joe Beuckman +license: No +copyright: No + + +# these should not be edited +name: TiBeacons +moduleid: org.beuckman.tibeacons +guid: 8d388e36-9093-4df8-a4d3-1db3621f04c0 +platform: iphone +minsdk: 3.1.3.GA diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..8416cba Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a606ca9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +tmp +bin +build +*.zip diff --git a/.project b/.project new file mode 100644 index 0000000..68f1548 --- /dev/null +++ b/.project @@ -0,0 +1,23 @@ + + + TiBeacons + + + + + + com.appcelerator.titanium.core.builder + + + + + com.aptana.ide.core.unifiedBuilder + + + + + + com.appcelerator.titanium.mobile.module.nature + com.aptana.projects.webnature + + diff --git a/.settings/com.aptana.editor.common.prefs b/.settings/com.aptana.editor.common.prefs new file mode 100644 index 0000000..fef713b --- /dev/null +++ b/.settings/com.aptana.editor.common.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +selectUserAgents=com.appcelerator.titanium.mobile.module.nature\:iphone diff --git a/CHANGELOG.txt b/CHANGELOG.txt new file mode 100644 index 0000000..de1e091 --- /dev/null +++ b/CHANGELOG.txt @@ -0,0 +1 @@ +Place your change log text here. This file will be incorporated with your app at package time. \ No newline at end of file diff --git a/Classes/.gitignore b/Classes/.gitignore new file mode 100644 index 0000000..afd7bb1 --- /dev/null +++ b/Classes/.gitignore @@ -0,0 +1,2 @@ +OrgBeuckmanTibeacons.h +OrgBeuckmanTibeacons.m diff --git a/Classes/OrgBeuckmanTibeaconsModule.h b/Classes/OrgBeuckmanTibeaconsModule.h new file mode 100644 index 0000000..5e08b0f --- /dev/null +++ b/Classes/OrgBeuckmanTibeaconsModule.h @@ -0,0 +1,17 @@ +/** + * Your Copyright Here + * + * Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc. + * and licensed under the Apache Public License (version 2) + */ +#import "TiModule.h" + +@import CoreLocation; +@import CoreBluetooth; + +@interface OrgBeuckmanTibeaconsModule : TiModule +{ + +} + +@end diff --git a/Classes/OrgBeuckmanTibeaconsModule.m b/Classes/OrgBeuckmanTibeaconsModule.m new file mode 100644 index 0000000..40ade92 --- /dev/null +++ b/Classes/OrgBeuckmanTibeaconsModule.m @@ -0,0 +1,350 @@ +/** + * Your Copyright Here + * + * Appcelerator Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc. + * and licensed under the Apache Public License (version 2) + */ +#import "OrgBeuckmanTibeaconsModule.h" +#import "TiBase.h" +#import "TiHost.h" +#import "TiUtils.h" + + +@interface OrgBeuckmanTibeaconsModule () + +@property (nonatomic, strong) CLLocationManager *locationManager; +@property (nonatomic, strong) CLBeaconRegion *beaconRegion; +@property (nonatomic, strong) CBPeripheralManager *peripheralManager; +@property (nonatomic, strong) NSArray *detectedBeacons; + +@end + +@implementation OrgBeuckmanTibeaconsModule + +#pragma mark Internal + +// this is generated for your module, please do not change it +-(id)moduleGUID +{ + return @"8d388e36-9093-4df8-a4d3-1db3621f04c0"; +} + +// this is generated for your module, please do not change it +-(NSString*)moduleId +{ + return @"org.beuckman.tibeacons"; +} + +#pragma mark Lifecycle + +-(void)startup +{ + // this method is called when the module is first loaded + // you *must* call the superclass + [super startup]; + + NSLog(@"[INFO] %@ loaded",self); +} + +-(void)shutdown:(id)sender +{ + // this method is called when the module is being unloaded + // typically this is during shutdown. make sure you don't do too + // much processing here or the app will be quit forceably + + // you *must* call the superclass + [super shutdown:sender]; +} + +#pragma mark Cleanup + +-(void)dealloc +{ + // release any resources that have been retained by the module + [super dealloc]; +} + +#pragma mark Internal Memory Management + +-(void)didReceiveMemoryWarning:(NSNotification*)notification +{ + // optionally release any resources that can be dynamically + // reloaded once memory is available - such as caches + [super didReceiveMemoryWarning:notification]; +} + +#pragma mark Listener Notifications + +-(void)_listenerAdded:(NSString *)type count:(int)count +{ + if (count == 1 && [type isEqualToString:@"my_event"]) + { + // the first (of potentially many) listener is being added + // for event named 'my_event' + } +} + +-(void)_listenerRemoved:(NSString *)type count:(int)count +{ + if (count == 0 && [type isEqualToString:@"my_event"]) + { + // the last listener called for event named 'my_event' has + // been removed, we can optionally clean up any resources + // since no body is listening at this point for that event + } +} + +#pragma Public APIs + +-(id)example:(id)args +{ + // example method + return @"hello world"; +} + +-(id)exampleProp +{ + // example property getter + return @"hello world"; +} + +-(void)setExampleProp:(id)value +{ + // example property setter +} + + + +#pragma mark - Beacon ranging +- (void)createBeaconRegionWithUUID:(NSString *)uuid andIdentifier:(NSString *)identifier +{ + if (self.beaconRegion) + return; + + NSUUID *proximityUUID = [[NSUUID alloc] initWithUUIDString:uuid]; + self.beaconRegion = [[CLBeaconRegion alloc] initWithProximityUUID:proximityUUID identifier:identifier]; + + self.beaconRegion.notifyEntryStateOnDisplay = true; +} + +- (void)turnOnRangingWithUUID:(NSString *)uuid andIdentifier:(NSString *)identifier +{ + NSLog(@"[INFO] Turning on ranging..."); + + if (![CLLocationManager isRangingAvailable]) { + NSLog(@"[INFO] Couldn't turn on ranging: Ranging is not available."); + return; + } + + if (self.locationManager.rangedRegions.count > 0) { + NSLog(@"[INFO] Didn't turn on ranging: Ranging already on."); + return; + } + + [self createBeaconRegionWithUUID:uuid andIdentifier:identifier]; + [self.locationManager startRangingBeaconsInRegion:self.beaconRegion]; + + NSLog(@"[INFO] Ranging turned on for region: %@.", self.beaconRegion); +} + + +- (void)startRangingForBeacons:(id)args +{ + ENSURE_UI_THREAD_1_ARG(args); + ENSURE_SINGLE_ARG(args, NSDictionary); + + NSString *uuid = [TiUtils stringValue:[args objectForKey:@"uuid"]]; + NSString *identifier = [TiUtils stringValue:[args objectForKey:@"identifier"]]; + + self.locationManager = [[CLLocationManager alloc] init]; + self.locationManager.delegate = self; + + self.detectedBeacons = [NSArray array]; + + [self turnOnRangingWithUUID:uuid andIdentifier:identifier]; +} + +- (void)stopRangingForBeacons:(id)args +{ + if (self.locationManager.rangedRegions.count == 0) { + NSLog(@"[INFO] Didn't turn off ranging: Ranging already off."); + return; + } + + [self.locationManager stopRangingBeaconsInRegion:self.beaconRegion]; + + self.detectedBeacons = [NSArray array]; + + NSLog(@"[INFO] Turned off ranging."); +} + + +#pragma mark - Beacon ranging delegate methods +- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status +{ + if (![CLLocationManager locationServicesEnabled]) { + NSLog(@"[INFO] Couldn't turn on ranging: Location services are not enabled."); + return; + } + + if ([CLLocationManager authorizationStatus] != kCLAuthorizationStatusAuthorized) { + NSLog(@"[INFO] Couldn't turn on ranging: Location services not authorised."); + return; + } + +} + +- (void)locationManager:(CLLocationManager *)manager + didRangeBeacons:(NSArray *)beacons + inRegion:(CLBeaconRegion *)region { + + NSArray *filteredBeacons = [self filteredBeacons:beacons]; + + if (filteredBeacons.count == 0) { + NSLog(@"[INFO] No beacons found nearby."); + } else { + NSLog(@"[INFO] Found %lu %@.", (unsigned long)[filteredBeacons count], + [filteredBeacons count] > 1 ? @"beacons" : @"beacon"); + } + + NSString *count = [NSString stringWithFormat:@"%lu", (unsigned long)[filteredBeacons count]]; + + NSDictionary *event = [[NSDictionary alloc] initWithObjectsAndKeys:count, @"count", nil]; + + [self fireEvent:@"beaconRanges" withObject:event]; + +} + + +- (NSArray *)filteredBeacons:(NSArray *)beacons +{ + // Filters duplicate beacons out; this may happen temporarily if the originating device changes its Bluetooth id + NSMutableArray *mutableBeacons = [beacons mutableCopy]; + + NSMutableSet *lookup = [[NSMutableSet alloc] init]; + for (int index = 0; index < [beacons count]; index++) { + CLBeacon *curr = [beacons objectAtIndex:index]; + NSString *identifier = [NSString stringWithFormat:@"%@/%@", curr.major, curr.minor]; + + // this is very fast constant time lookup in a hash table + if ([lookup containsObject:identifier]) { + [mutableBeacons removeObjectAtIndex:index]; + } else { + [lookup addObject:identifier]; + } + } + + return [mutableBeacons copy]; +} + + + +#pragma mark - Beacon advertising +- (void)turnOnAdvertising +{ + if (self.peripheralManager.state != CBPeripheralManagerStatePoweredOn) { + NSLog(@"[INFO] Peripheral manager is off."); + return; + } + + time_t t; + srand((unsigned) time(&t)); + CLBeaconRegion *region = [[CLBeaconRegion alloc] initWithProximityUUID:self.beaconRegion.proximityUUID + major:rand() + minor:rand() + identifier:self.beaconRegion.identifier]; + NSDictionary *beaconPeripheralData = [region peripheralDataWithMeasuredPower:nil]; + [self.peripheralManager startAdvertising:beaconPeripheralData]; + + NSLog(@"[INFO] Turning on advertising for region: %@.", region); +} + + +- (void)startAdvertisingBeacon:(id)args +{ + ENSURE_UI_THREAD_1_ARG(args); + ENSURE_SINGLE_ARG(args, NSDictionary); + + NSString *uuid = [TiUtils stringValue:[args objectForKey:@"uuid"]]; + NSString *identifier = [TiUtils stringValue:[args objectForKey:@"identifier"]]; + + NSLog(@"[INFO] Turning on advertising..."); + + [self createBeaconRegionWithUUID:uuid andIdentifier:identifier]; + + if (!self.peripheralManager) + self.peripheralManager = [[CBPeripheralManager alloc] initWithDelegate:self queue:nil options:nil]; + + [self turnOnAdvertising]; +} + +- (void)stopAdvertisingBeacon:(id)args +{ + [self.peripheralManager stopAdvertising]; + + NSLog(@"[INFO] Turned off advertising."); +} + +#pragma mark - Beacon advertising delegate methods +- (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager *)peripheralManager error:(NSError *)error +{ + if (error) { + NSLog(@"[INFO] Couldn't turn on advertising: %@", error); + + return; + } + + if (peripheralManager.isAdvertising) { + NSLog(@"[INFO] Turned on advertising."); + + [self fireEvent:@"advertisingStatus" withObject:[[NSDictionary alloc] initWithObjectsAndKeys: @"on", @"status", nil]]; + } +} + +- (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheralManager +{ + if (peripheralManager.state != CBPeripheralManagerStatePoweredOn) { + NSLog(@"[INFO] Peripheral manager is off."); + return; + } + + NSLog(@"[INFO] Peripheral manager is on."); + + [self turnOnAdvertising]; +} + + + + +- (NSDictionary *)detailsForBeacon:(CLBeacon *)beacon +{ + + NSString *proximity; + switch (beacon.proximity) { + case CLProximityNear: + proximity = @"Near"; + break; + case CLProximityImmediate: + proximity = @"Immediate"; + break; + case CLProximityFar: + proximity = @"Far"; + break; + case CLProximityUnknown: + default: + proximity = @"Unknown"; + break; + } + + return [[NSDictionary alloc] initWithObjectsAndKeys: + beacon.major, @"major", + beacon.minor, @"minor", + proximity, @"proximity", + beacon.accuracy, @"accuracy", + beacon.rssi, @"rssi", + nil + ]; +} + + +@end diff --git a/Classes/OrgBeuckmanTibeaconsModuleAssets.h b/Classes/OrgBeuckmanTibeaconsModuleAssets.h new file mode 100644 index 0000000..7f1a9ae --- /dev/null +++ b/Classes/OrgBeuckmanTibeaconsModuleAssets.h @@ -0,0 +1,11 @@ +/** + * This is a generated file. Do not edit or your changes will be lost + */ + +@interface OrgBeuckmanTibeaconsModuleAssets : NSObject +{ +} +- (NSData*) moduleAsset; +- (NSData*) resolveModuleAsset:(NSString*)path; + +@end diff --git a/Classes/OrgBeuckmanTibeaconsModuleAssets.m b/Classes/OrgBeuckmanTibeaconsModuleAssets.m new file mode 100644 index 0000000..53c57ca --- /dev/null +++ b/Classes/OrgBeuckmanTibeaconsModuleAssets.m @@ -0,0 +1,26 @@ +/** + * This is a generated file. Do not edit or your changes will be lost + */ +#import "OrgBeuckmanTibeaconsModuleAssets.h" + +extern NSData* filterDataInRange(NSData* thedata, NSRange range); + +@implementation OrgBeuckmanTibeaconsModuleAssets + +- (NSData*) moduleAsset +{ + //##TI_AUTOGEN_BEGIN asset + //Compiler generates code for asset here + return nil; // DEFAULT BEHAVIOR + //##TI_AUTOGEN_END asset +} + +- (NSData*) resolveModuleAsset:(NSString*)path +{ + //##TI_AUTOGEN_BEGIN resolve_asset + //Compiler generates code for asset resolution here + return nil; // DEFAULT BEHAVIOR + //##TI_AUTOGEN_END resolve_asset +} + +@end diff --git a/CoreBluetooth.framework/CoreBluetooth b/CoreBluetooth.framework/CoreBluetooth new file mode 100755 index 0000000..33a41d4 Binary files /dev/null and b/CoreBluetooth.framework/CoreBluetooth differ diff --git a/CoreBluetooth.framework/Headers/CBATTRequest.h b/CoreBluetooth.framework/Headers/CBATTRequest.h new file mode 100644 index 0000000..3a9e6e3 --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBATTRequest.h @@ -0,0 +1,59 @@ +/* + * @file CBATTRequest.h + * @framework CoreBluetooth + * + * @discussion + * + * @copyright 2012 Apple, Inc. All rights reserved. + */ + +#import + +#import + +@class CBCentral, CBCharacteristic; + +/*! + * @class CBATTRequest + * + * @discussion Represents a read or write request from a central. + * + */ +NS_CLASS_AVAILABLE(NA, 6_0) +CB_EXTERN_CLASS @interface CBATTRequest : NSObject + +/*! + * @property central + * + * @discussion The central that originated the request. + * + */ +@property(readonly, retain, nonatomic) CBCentral *central; + +/*! + * @property characteristic + * + * @discussion The characteristic whose value will be read or written. + * + */ +@property(readonly, retain, nonatomic) CBCharacteristic *characteristic; + +/*! + * @property offset + * + * @discussion The zero-based index of the first byte for the read or write. + * + */ +@property(readonly, nonatomic) NSUInteger offset; + +/*! + * @property value + * + * @discussion The data being read or written. + * For read requests, value will be nil and should be set before responding via @link respondToRequest:withResult: @/link. + * For write requests, value will contain the data to be written. + * + */ +@property(readwrite, copy) NSData *value; + +@end diff --git a/CoreBluetooth.framework/Headers/CBAdvertisementData.h b/CoreBluetooth.framework/Headers/CBAdvertisementData.h new file mode 100644 index 0000000..8c87761 --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBAdvertisementData.h @@ -0,0 +1,86 @@ +/* + * @file CBAdvertisementData.h + * @framework CoreBluetooth + * + * @copyright 2012 Apple, Inc. All rights reserved. + */ + +#import +#import + +/*! + * @constant CBAdvertisementDataLocalNameKey + * + * @discussion A NSString containing the local name of a peripheral. + * + */ +CB_EXTERN NSString * const CBAdvertisementDataLocalNameKey; + + +/*! + * @constant CBAdvertisementDataTxPowerLevelKey + * + * @discussion A NSNumber containing the transmit power of a peripheral. + * + */ +CB_EXTERN NSString * const CBAdvertisementDataTxPowerLevelKey; + + +/*! + * @constant CBAdvertisementDataServiceUUIDsKey + * + * @discussion A list of one or more CBUUID objects, representing CBService UUIDs. + * + */ +CB_EXTERN NSString * const CBAdvertisementDataServiceUUIDsKey; + + +/*! + * @constant CBAdvertisementDataServiceDataKey + * + * @discussion A dictionary containing service-specific advertisement data. Keys are CBUUID objects, representing + * CBService UUIDs. Values are NSData objects. + * + */ +CB_EXTERN NSString * const CBAdvertisementDataServiceDataKey; + + +/*! + * @constant CBAdvertisementDataManufacturerDataKey + * + * @discussion A NSData object containing the manufacturer data of a peripheral. + * + */ +CB_EXTERN NSString * const CBAdvertisementDataManufacturerDataKey; + + +/*! + * @constant CBAdvertisementDataOverflowServiceUUIDsKey + * + * @discussion A list of one or more CBUUID objects, representing CBService UUIDs that were + * found in the "overflow" area of the advertising data. Due to the nature of the data stored in this area, + * UUIDs listed here are "best effort" and may not always be accurate. + * + * @see startAdvertising: + * + */ +CB_EXTERN NSString * const CBAdvertisementDataOverflowServiceUUIDsKey NS_AVAILABLE(NA, 6_0); + + +/*! + * @constant CBAdvertisementDataIsConnectable + * + * @discussion A NSNumber (Boolean) indicating whether or not the advertising event type was connectable. This can be used to determine + * whether or not a peripheral is connectable in that instant. + * + */ +CB_EXTERN NSString * const CBAdvertisementDataIsConnectable NS_AVAILABLE(NA, 7_0); + + +/*! + * @constant CBAdvertisementDataSolicitedServiceUUIDsKey + * + * @discussion A list of one or more CBUUID objects, representing CBService UUIDs. + * + */ +CB_EXTERN NSString * const CBAdvertisementDataSolicitedServiceUUIDsKey NS_AVAILABLE(NA, 7_0); diff --git a/CoreBluetooth.framework/Headers/CBCentral.h b/CoreBluetooth.framework/Headers/CBCentral.h new file mode 100644 index 0000000..8a6f3ec --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBCentral.h @@ -0,0 +1,49 @@ +/* + * @file CBCentral.h + * @framework CoreBluetooth + * + * @discussion Representation of a remote central. + * + * @copyright 2012 Apple, Inc. All rights reserved. + */ + +#import +#import + + +/*! + * @class CBCentral + * + * @discussion Represents a remote central. + * + */ +NS_CLASS_AVAILABLE(NA, 6_0) +CB_EXTERN_CLASS @interface CBCentral : NSObject + +/*! + * @property UUID + * + * @discussion The UUID of the central. This UUID can be used to retrieve the equivalent @link CBPeripheral @/link object via @link retrievePeripherals: @/link. + * + * @deprecated Use the {@link identifier} property instead. + */ +@property(readonly, nonatomic) CFUUIDRef UUID NS_DEPRECATED(NA, NA, 5_0, 7_0); + +/*! + * @property identifier + * + * @discussion The unique identifier associated with the central. This identifier can be used to retrieve the equivalent @link CBPeripheral @/link object + * via @link retrievePeripheralsWithIdentifiers: @/link. + */ +@property(readonly, nonatomic) NSUUID *identifier; + +/*! + * @property maximumUpdateValueLength + * + * @discussion The maximum amount of data, in bytes, that can be received by the central in a single notification or indication. + + * @see updateValue:forCharacteristic:onSubscribedCentrals: + */ +@property(readonly, nonatomic) NSUInteger maximumUpdateValueLength; + +@end diff --git a/CoreBluetooth.framework/Headers/CBCentralManager.h b/CoreBluetooth.framework/Headers/CBCentralManager.h new file mode 100644 index 0000000..b7012bc --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBCentralManager.h @@ -0,0 +1,334 @@ +/* + * @file CBCentralManager.h + * @framework CoreBluetooth + * + * @discussion Entry point to the central role. + * + * @copyright 2011 Apple, Inc. All rights reserved. + */ + +#import +#import +#import +#import + +/*! + * @enum CBCentralManagerState + * + * @discussion Represents the current state of a CBCentralManager. + * + * @constant CBCentralManagerStateUnknown State unknown, update imminent. + * @constant CBCentralManagerStateResetting The connection with the system service was momentarily lost, update imminent. + * @constant CBCentralManagerStateUnsupported The platform doesn't support the Bluetooth Low Energy Central/Client role. + * @constant CBCentralManagerStateUnauthorized The application is not authorized to use the Bluetooth Low Energy Central/Client role. + * @constant CBCentralManagerStatePoweredOff Bluetooth is currently powered off. + * @constant CBCentralManagerStatePoweredOn Bluetooth is currently powered on and available to use. + * + */ +typedef NS_ENUM(NSInteger, CBCentralManagerState) { + CBCentralManagerStateUnknown = 0, + CBCentralManagerStateResetting, + CBCentralManagerStateUnsupported, + CBCentralManagerStateUnauthorized, + CBCentralManagerStatePoweredOff, + CBCentralManagerStatePoweredOn, +}; + +@protocol CBCentralManagerDelegate; +@class CBUUID, CBPeripheral; + +/*! + * @class CBCentralManager + * + * @discussion Entry point to the central role. Commands should only be issued when its state is CBCentralManagerStatePoweredOn. + * + */ +NS_CLASS_AVAILABLE(10_7, 5_0) +CB_EXTERN_CLASS @interface CBCentralManager : NSObject + +/*! + * @property delegate + * + * @discussion The delegate object that will receive central events. + * + */ +@property(weak, nonatomic) id delegate; + +/*! + * @property state + * + * @discussion The current state of the peripheral, initially set to CBCentralManagerStateUnknown. Updates are provided by required + * delegate method {@link centralManagerDidUpdateState:}. + * + */ +@property(readonly) CBCentralManagerState state; + +/*! + * @method initWithDelegate:queue: + * + * @param delegate The delegate that will receive central role events. + * @param queue The dispatch queue on which the events will be dispatched. + * + * @discussion The initialization call. The events of the central role will be dispatched on the provided queue. + * If nil, the main queue will be used. + * + */ +- (id)initWithDelegate:(id)delegate queue:(dispatch_queue_t)queue; + +/*! + * @method initWithDelegate:queue:options: + * + * @param delegate The delegate that will receive central role events. + * @param queue The dispatch queue on which the events will be dispatched. + * @param options An optional dictionary specifying options for the manager. + * + * @discussion The initialization call. The events of the central role will be dispatched on the provided queue. + * If nil, the main queue will be used. + * + * @seealso CBCentralManagerOptionShowPowerAlertKey + * @seealso CBCentralManagerOptionRestoreIdentifierKey + * + */ +- (id)initWithDelegate:(id)delegate queue:(dispatch_queue_t)queue options:(NSDictionary *)options NS_AVAILABLE(NA, 7_0); + +/*! + * @method retrievePeripherals: + * + * @param peripheralUUIDs A list of CFUUIDRef objects. + * + * @discussion Attempts to retrieve the CBPeripheral object(s) that correspond to peripheralUUIDs. + * + * @deprecated Use {@link retrievePeripheralsWithIdentifiers:} instead. + * + * @see centralManager:didRetrievePeripherals: + * + */ +- (void)retrievePeripherals:(NSArray *)peripheralUUIDs NS_DEPRECATED(NA, NA, 5_0, 7_0); + +/*! + * @method retrievePeripheralsWithIdentifiers: + * + * @param identifiers A list of NSUUID objects. + * + * @discussion Attempts to retrieve the CBPeripheral object(s) with the corresponding identifiers. + * + * @return A list of CBPeripheral objects. + * + */ +- (NSArray *)retrievePeripheralsWithIdentifiers:(NSArray *)identifiers NS_AVAILABLE(NA, 7_0); + +/*! + * @method retrieveConnectedPeripherals + * + * @discussion Retrieves all peripherals that are connected to the system. Note that this set can include peripherals which were connected by other + * applications, which will need to be connected locally via {@link connectPeripheral:options:} before they can be used. + * + * @deprecated Use {@link retrieveConnectedPeripheralsWithServices:} instead. + * + * @see centralManager:didRetrieveConnectedPeripherals: + * + */ +- (void)retrieveConnectedPeripherals NS_DEPRECATED(NA, NA, 5_0, 7_0); + +/*! + * @method retrieveConnectedPeripheralsWithServices + * + * @discussion Retrieves all peripherals that are connected to the system and implement any of the services listed in serviceUUIDs. + * Note that this set can include peripherals which were connected by other applications, which will need to be connected locally + * via {@link connectPeripheral:options:} before they can be used. + * + * @return A list of CBPeripheral objects. + * + */ +- (NSArray *)retrieveConnectedPeripheralsWithServices:(NSArray *)serviceUUIDs NS_AVAILABLE(NA, 7_0); + +/*! + * @method scanForPeripheralsWithServices:options: + * + * @param serviceUUIDs A list of CBUUID objects representing the service(s) to scan for. + * @param options An optional dictionary specifying options for the scan. + * + * @discussion Starts scanning for peripherals that are advertising any of the services listed in serviceUUIDs. Although strongly discouraged, + * if serviceUUIDs is nil all discovered peripherals will be returned. If the central is already scanning with different + * serviceUUIDs or options, the provided parameters will replace them. + * Applications that have specified the bluetooth-central background mode are allowed to scan while backgrounded, with two + * caveats: the scan must specify one or more service types in serviceUUIDs, and the CBCentralManagerScanOptionAllowDuplicatesKey + * scan option will be ignored. + * + * @see centralManager:didDiscoverPeripheral:advertisementData:RSSI: + * @seealso CBCentralManagerScanOptionAllowDuplicatesKey + * @seealso CBCentralManagerScanOptionSolicitedServiceUUIDsKey + * + */ +- (void)scanForPeripheralsWithServices:(NSArray *)serviceUUIDs options:(NSDictionary *)options; + +/*! + * @method stopScan: + * + * @discussion Stops scanning for peripherals. + * + */ +- (void)stopScan; + +/*! + * @method connectPeripheral:options: + * + * @param peripheral The CBPeripheral to be connected. + * @param options An optional dictionary specifying connection behavior options. + * + * @discussion Initiates a connection to peripheral. Connection attempts never time out and, depending on the outcome, will result + * in a call to either {@link centralManager:didConnectPeripheral:} or {@link centralManager:didFailToConnectPeripheral:error:}. + * Pending attempts are cancelled automatically upon deallocation of peripheral, and explicitly via {@link cancelPeripheralConnection}. + * + * @see centralManager:didConnectPeripheral: + * @see centralManager:didFailToConnectPeripheral:error: + * @seealso CBConnectPeripheralOptionNotifyOnConnectionKey + * @seealso CBConnectPeripheralOptionNotifyOnDisconnectionKey + * @seealso CBConnectPeripheralOptionNotifyOnNotificationKey + * + */ +- (void)connectPeripheral:(CBPeripheral *)peripheral options:(NSDictionary *)options; + +/*! + * @method cancelPeripheralConnection: + * + * @param peripheral A CBPeripheral. + * + * @discussion Cancels an active or pending connection to peripheral. Note that this is non-blocking, and any CBPeripheral + * commands that are still pending to peripheral may or may not complete. + * + * @see centralManager:didDisconnectPeripheral:error: + * + */ +- (void)cancelPeripheralConnection:(CBPeripheral *)peripheral; + +@end + + +/*! + * @protocol CBCentralManagerDelegate + * + * @discussion The delegate of a {@link CBCentralManager} object must adopt the CBCentralManagerDelegate protocol. The + * single required method indicates the availability of the central manager, while the optional methods allow for the discovery and + * connection of peripherals. + * + */ +@protocol CBCentralManagerDelegate + +@required + +/*! + * @method centralManagerDidUpdateState: + * + * @param central The central manager whose state has changed. + * + * @discussion Invoked whenever the central manager's state has been updated. Commands should only be issued when the state is + * CBCentralManagerStatePoweredOn. A state below CBCentralManagerStatePoweredOn + * implies that scanning has stopped and any connected peripherals have been disconnected. If the state moves below + * CBCentralManagerStatePoweredOff, all CBPeripheral objects obtained from this central + * manager become invalid and must be retrieved or discovered again. + * + * @see state + * + */ +- (void)centralManagerDidUpdateState:(CBCentralManager *)central; + +@optional + +/*! + * @method centralManager:willRestoreState: + * + * @param central The central manager providing this information. + * @param dict A dictionary containing information about central that was preserved by the system at the time the app was terminated. + * + * @discussion For apps that opt-in to state preservation and restoration, this is the first method invoked when your app is relaunched into + * the background to complete some Bluetooth-related task. Use this method to synchronize your app's state with the state of the + * Bluetooth system. + * + * @seealso CBCentralManagerRestoredStatePeripheralsKey; + * @seealso CBCentralManagerRestoredStateScanServicesKey; + * @seealso CBCentralManagerRestoredStateScanOptionsKey; + * + */ +- (void)centralManager:(CBCentralManager *)central willRestoreState:(NSDictionary *)dict; + +/*! + * @method centralManager:didRetrievePeripherals: + * + * @param central The central manager providing this information. + * @param peripherals A list of CBPeripheral objects. + * + * @discussion This method returns the result of a {@link retrievePeripherals} call, with the peripheral(s) that the central manager was + * able to match to the provided UUID(s). + * + */ +- (void)centralManager:(CBCentralManager *)central didRetrievePeripherals:(NSArray *)peripherals; + +/*! + * @method centralManager:didRetrieveConnectedPeripherals: + * + * @param central The central manager providing this information. + * @param peripherals A list of CBPeripheral objects representing all peripherals currently connected to the system. + * + * @discussion This method returns the result of a {@link retrieveConnectedPeripherals} call. + * + */ +- (void)centralManager:(CBCentralManager *)central didRetrieveConnectedPeripherals:(NSArray *)peripherals; + +/*! + * @method centralManager:didDiscoverPeripheral:advertisementData:RSSI: + * + * @param central The central manager providing this update. + * @param peripheral A CBPeripheral object. + * @param advertisementData A dictionary containing any advertisement and scan response data. + * @param RSSI The current RSSI of peripheral, in dBm. A value of 127 is reserved and indicates the RSSI + * was not available. + * + * @discussion This method is invoked while scanning, upon the discovery of peripheral by central. A discovered peripheral must + * be retained in order to use it; otherwise, it is assumed to not be of interest and will be cleaned up by the central manager. For + * a list of advertisementData keys, see {@link CBAdvertisementDataLocalNameKey} and other similar constants. + * + * @seealso CBAdvertisementData.h + * + */ +- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI; + +/*! + * @method centralManager:didConnectPeripheral: + * + * @param central The central manager providing this information. + * @param peripheral The CBPeripheral that has connected. + * + * @discussion This method is invoked when a connection initiated by {@link connectPeripheral:options:} has succeeded. + * + */ +- (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral; + +/*! + * @method centralManager:didFailToConnectPeripheral:error: + * + * @param central The central manager providing this information. + * @param peripheral The CBPeripheral that has failed to connect. + * @param error The cause of the failure. + * + * @discussion This method is invoked when a connection initiated by {@link connectPeripheral:options:} has failed to complete. As connection attempts do not + * timeout, the failure of a connection is atypical and usually indicative of a transient issue. + * + */ +- (void)centralManager:(CBCentralManager *)central didFailToConnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error; + +/*! + * @method centralManager:didDisconnectPeripheral:error: + * + * @param central The central manager providing this information. + * @param peripheral The CBPeripheral that has disconnected. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method is invoked upon the disconnection of a peripheral that was connected by {@link connectPeripheral:options:}. If the disconnection + * was not initiated by {@link cancelPeripheralConnection}, the cause will be detailed in the error parameter. Once this method has been + * called, no more methods will be invoked on peripheral's CBPeripheralDelegate. + * + */ +- (void)centralManager:(CBCentralManager *)central didDisconnectPeripheral:(CBPeripheral *)peripheral error:(NSError *)error; + +@end diff --git a/CoreBluetooth.framework/Headers/CBCentralManagerConstants.h b/CoreBluetooth.framework/Headers/CBCentralManagerConstants.h new file mode 100644 index 0000000..7c6e776 --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBCentralManagerConstants.h @@ -0,0 +1,134 @@ +/* + * @file CBCentralManagerConstants.h + * @framework CoreBluetooth + * + * @copyright 2013 Apple, Inc. All rights reserved. + */ + +#import +#import + +/*! + * @const CBCentralManagerOptionShowPowerAlertKey + * + * @discussion A NSNumber (Boolean) indicating that the system should, if Bluetooth is powered off when CBCentralManager is instantiated, display + * a warning dialog to the user. + * + * @see initWithDelegate:queue:options: + * + */ +CB_EXTERN NSString * const CBCentralManagerOptionShowPowerAlertKey NS_AVAILABLE(NA, 7_0); + +/*! + * @const CBCentralManagerOptionRestoreIdentifierKey + * + * @discussion A NSString containing a unique identifier (UID) for the CBCentralManager that is being instantiated. This UID is used + * by the system to identify a specific CBCentralManager instance for restoration and, therefore, must remain the same for + * subsequent application executions in order for the manager to be restored. + * + * @see initWithDelegate:queue:options: + * @seealso centralManager:willRestoreState: + * + */ +CB_EXTERN NSString * const CBCentralManagerOptionRestoreIdentifierKey NS_AVAILABLE(NA, 7_0); + +/*! + * @const CBCentralManagerScanOptionAllowDuplicatesKey + * + * @discussion A NSNumber (Boolean) indicating that the scan should run without duplicate filtering. By default, multiple discoveries of the + * same peripheral are coalesced into a single discovery event. Specifying this option will cause a discovery event to be generated + * every time the peripheral is seen, which may be many times per second. This can be useful in specific situations, such as making + * a connection based on a peripheral's RSSI, but may have an adverse affect on battery-life and application performance. + * + * @see scanForPeripheralsWithServices:options: + * + */ +CB_EXTERN NSString * const CBCentralManagerScanOptionAllowDuplicatesKey; + +/*! + * @const CBCentralManagerScanOptionSolicitedServiceUUIDsKey + * + * @discussion An NSArray of CBUUID objects respresenting service UUIDs. Causes the scan to also look for peripherals soliciting + * any of the services contained in the list. + * + * @see scanForPeripheralsWithServices:options: + * + */ +CB_EXTERN NSString * const CBCentralManagerScanOptionSolicitedServiceUUIDsKey NS_AVAILABLE(NA, 7_0); + +/*! + * @const CBConnectPeripheralOptionNotifyOnConnectionKey + * + * @discussion A NSNumber (Boolean) indicating that the system should display a connection alert for a given peripheral, if the application is suspended + * when a successful connection is made. + * This is useful for applications that have not specified the bluetooth-central background mode and cannot display their + * own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground + * will receive the alert. + * + * @see connectPeripheral: + * + */ +CB_EXTERN NSString * const CBConnectPeripheralOptionNotifyOnConnectionKey NS_AVAILABLE(NA, 6_0); + +/*! + * @const CBConnectPeripheralOptionNotifyOnDisconnectionKey + * + * @discussion A NSNumber (Boolean) indicating that the system should display a disconnection alert for a given peripheral, if the application + * is suspended at the time of the disconnection. + * This is useful for applications that have not specified the bluetooth-central background mode and cannot display their + * own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground + * will receive the alert. + * + * @see connectPeripheral: + * + */ +CB_EXTERN NSString * const CBConnectPeripheralOptionNotifyOnDisconnectionKey; + +/*! + * @const CBConnectPeripheralOptionNotifyOnNotificationKey + * + * @discussion A NSNumber (Boolean) indicating that the system should display an alert for all notifications received from a given peripheral, if + * the application is suspended at the time. + * This is useful for applications that have not specified the bluetooth-central background mode and cannot display their + * own alert. If more than one application has requested notification for a given peripheral, the one that was most recently in the foreground + * will receive the alert. + * + * @see connectPeripheral: + * + */ +CB_EXTERN NSString * const CBConnectPeripheralOptionNotifyOnNotificationKey NS_AVAILABLE(NA, 6_0); + +/*! + * @const CBCentralManagerRestoredStatePeripheralsKey + * + * @discussion An NSArray of CBPeripheral objects containing all peripherals that were connected or pending connection at the time the + * application was terminated by the system. When possible, all known information for each peripheral will be restored, including any discovered + * services, characteristics and descriptors, as well as characteristic notification states. + * + * @see centralManager:willRestoreState: + * @seealso connectPeripheral:options: + * + */ +CB_EXTERN NSString * const CBCentralManagerRestoredStatePeripheralsKey NS_AVAILABLE(NA, 7_0); + +/*! + * @const CBCentralManagerRestoredStateScanServicesKey + * + * @discussion An NSArray of CBUUID objects containing the service(s) being scanned for at the time the application was terminated by the system. + * + * @see centralManager:willRestoreState: + * @seealso scanForPeripheralsWithServices:options: + * + */ +CB_EXTERN NSString * const CBCentralManagerRestoredStateScanServicesKey NS_AVAILABLE(NA, 7_0); + +/*! + * @const CBCentralManagerRestoredStateScanOptionsKey + * + * @discussion A NSDictionary containing the scan options at the time the application was terminated by the system. + * + * @see centralManager:willRestoreState: + * @seealso scanForPeripheralsWithServices:options: + * + */ +CB_EXTERN NSString * const CBCentralManagerRestoredStateScanOptionsKey NS_AVAILABLE(NA, 7_0); diff --git a/CoreBluetooth.framework/Headers/CBCharacteristic.h b/CoreBluetooth.framework/Headers/CBCharacteristic.h new file mode 100644 index 0000000..a8c227d --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBCharacteristic.h @@ -0,0 +1,191 @@ +/* + * @file CBCharacteristic.h + * @framework CoreBluetooth + * + * @copyright 2011 Apple, Inc. All rights reserved. + */ + +#import + +#import + + + +/*! + * @enum CBCharacteristicProperties + * + * @discussion Characteristic properties determine how the characteristic value can be used, or how the descriptor(s) can be accessed. Can be combined. Unless + * otherwise specified, properties are valid for local characteristics published via @link CBPeripheralManager @/link. + * + * @constant CBCharacteristicPropertyBroadcast Permits broadcasts of the characteristic value using a characteristic configuration descriptor. Not allowed for local characteristics. + * @constant CBCharacteristicPropertyRead Permits reads of the characteristic value. + * @constant CBCharacteristicPropertyWriteWithoutResponse Permits writes of the characteristic value, without a response. + * @constant CBCharacteristicPropertyWrite Permits writes of the characteristic value. + * @constant CBCharacteristicPropertyNotify Permits notifications of the characteristic value, without a response. + * @constant CBCharacteristicPropertyIndicate Permits indications of the characteristic value. + * @constant CBCharacteristicPropertyAuthenticatedSignedWrites Permits signed writes of the characteristic value + * @constant CBCharacteristicPropertyExtendedProperties If set, additional characteristic properties are defined in the characteristic extended properties descriptor. Not allowed for local characteristics. + * @constant CBCharacteristicPropertyNotifyEncryptionRequired If set, only trusted devices can enable notifications of the characteristic value. + * @constant CBCharacteristicPropertyIndicateEncryptionRequired If set, only trusted devices can enable indications of the characteristic value. + * + */ +typedef NS_OPTIONS(NSInteger, CBCharacteristicProperties) { + CBCharacteristicPropertyBroadcast = 0x01, + CBCharacteristicPropertyRead = 0x02, + CBCharacteristicPropertyWriteWithoutResponse = 0x04, + CBCharacteristicPropertyWrite = 0x08, + CBCharacteristicPropertyNotify = 0x10, + CBCharacteristicPropertyIndicate = 0x20, + CBCharacteristicPropertyAuthenticatedSignedWrites = 0x40, + CBCharacteristicPropertyExtendedProperties = 0x80, + CBCharacteristicPropertyNotifyEncryptionRequired NS_ENUM_AVAILABLE(NA, 6_0) = 0x100, + CBCharacteristicPropertyIndicateEncryptionRequired NS_ENUM_AVAILABLE(NA, 6_0) = 0x200 +}; + + + +@class CBService, CBUUID; + +/*! + * @class CBCharacteristic + * + * @discussion + * Represents a service's characteristic. + * + */ +NS_CLASS_AVAILABLE(10_7, 5_0) +CB_EXTERN_CLASS @interface CBCharacteristic : NSObject + +/*! + * @property service + * + * @discussion + * A back-pointer to the service this characteristic belongs to. + * + */ +@property(weak, readonly, nonatomic) CBService *service; + +/*! + * @property UUID + * + * @discussion + * The Bluetooth UUID of the characteristic. + * + */ +@property(readonly, nonatomic) CBUUID *UUID; + +/*! + * @property properties + * + * @discussion + * The properties of the characteristic. + * + */ +@property(readonly, nonatomic) CBCharacteristicProperties properties; + +/*! + * @property value + * + * @discussion + * The value of the characteristic. + * + */ +@property(retain, readonly) NSData *value; + +/*! + * @property descriptors + * + * @discussion + * A list of the CBDescriptors that have so far been discovered in this characteristic. + * + */ +@property(retain, readonly) NSArray *descriptors; + +/*! + * @property isBroadcasted + * + * @discussion + * Whether the characteristic is currently broadcasted or not. + * + */ +@property(readonly) BOOL isBroadcasted; + +/*! + * @property isNotifying + * + * @discussion + * Whether the characteristic is currently notifying or not. + * + */ +@property(readonly) BOOL isNotifying; + +@end + +/*! + * @enum CBAttributePermissions + * + * @discussion Read, write, and encryption permissions for an ATT attribute. Can be combined. + * + * @constant CBAttributePermissionsReadable Read-only. + * @constant CBAttributePermissionsWriteable Write-only. + * @constant CBAttributePermissionsReadEncryptionRequired Readable by trusted devices. + * @constant CBAttributePermissionsWriteEncryptionRequired Writeable by trusted devices. + * + */ +typedef NS_OPTIONS(NSInteger, CBAttributePermissions) { + CBAttributePermissionsReadable = 0x01, + CBAttributePermissionsWriteable = 0x02, + CBAttributePermissionsReadEncryptionRequired = 0x04, + CBAttributePermissionsWriteEncryptionRequired = 0x08 +} NS_ENUM_AVAILABLE(NA, 6_0); + + +/*! + * @class CBMutableCharacteristic + * + * @discussion Used to create a local characteristic, which can be added to the local database via CBPeripheralManager. Once a characteristic + * is published, it is cached and can no longer be changed. + * If a characteristic value is specified, it will be cached and marked CBCharacteristicPropertyRead and + * CBAttributePermissionsReadable. If a characteristic value needs to be writeable, or may change during the lifetime of the + * published CBService, it is considered a dynamic value and will be requested on-demand. Dynamic values are identified by a + * value of nil. + * + */ +NS_CLASS_AVAILABLE(NA, 6_0) +CB_EXTERN_CLASS @interface CBMutableCharacteristic : CBCharacteristic + +/*! + * @property permissions + * + * @discussion The permissions of the characteristic value. + * + * @see CBAttributePermissions + */ +@property(assign, readwrite, nonatomic) CBAttributePermissions permissions; + +/*! + * @property subscribedCentrals + * + * @discussion For notifying characteristics, the set of currently subscribed centrals. + */ +@property(retain, readonly) NSArray *subscribedCentrals NS_AVAILABLE(NA, 7_0); + +@property(retain, readwrite, nonatomic) CBUUID *UUID; +@property(assign, readwrite, nonatomic) CBCharacteristicProperties properties; +@property(retain, readwrite) NSData *value; +@property(retain, readwrite) NSArray *descriptors; + +/*! + * @method initWithType:properties:value:permissions + * + * @param UUID The Bluetooth UUID of the characteristic. + * @param properties The properties of the characteristic. + * @param value The characteristic value to be cached. If nil, the value will be dynamic and requested on-demand. + * @param permissions The permissions of the characteristic value. + * + * @discussion Returns an initialized characteristic. + * + */ +- (id)initWithType:(CBUUID *)UUID properties:(CBCharacteristicProperties)properties value:(NSData *)value permissions:(CBAttributePermissions)permissions; + +@end diff --git a/CoreBluetooth.framework/Headers/CBDefines.h b/CoreBluetooth.framework/Headers/CBDefines.h new file mode 100644 index 0000000..0a63c11 --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBDefines.h @@ -0,0 +1,16 @@ +/* + * CBDefines.h + * CoreBluetooth + * + * Copyright 2011 Apple, Inc. All rights reserved. + */ + +#ifndef CB_EXTERN +#ifdef __cplusplus +#define CB_EXTERN extern "C" __attribute__((visibility ("default"))) +#else +#define CB_EXTERN extern __attribute__((visibility ("default"))) +#endif +#endif + +#define CB_EXTERN_CLASS __attribute__((visibility("default"))) diff --git a/CoreBluetooth.framework/Headers/CBDescriptor.h b/CoreBluetooth.framework/Headers/CBDescriptor.h new file mode 100644 index 0000000..6153c15 --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBDescriptor.h @@ -0,0 +1,81 @@ +/* + * @file CBDescriptor.h + * @framework CoreBluetooth + * + * @copyright 2011 Apple, Inc. All rights reserved. + */ + +#import + +#import + + + +@class CBCharacteristic, CBUUID; + +/*! + * @class CBDescriptor + * + * @discussion + * Represents a characteristic's descriptor. + * + */ +NS_CLASS_AVAILABLE(10_7, 5_0) +CB_EXTERN_CLASS @interface CBDescriptor : NSObject + +/*! + * @property characteristic + * + * @discussion + * A back-pointer to the characteristic this descriptor belongs to. + * + */ +@property(weak, readonly, nonatomic) CBCharacteristic *characteristic; + +/*! + * @property UUID + * + * @discussion + * The Bluetooth UUID of the descriptor. + * + */ +@property(readonly, nonatomic) CBUUID *UUID; + +/*! + * @property value + * + * @discussion + * The value of the descriptor. The corresponding value types for the various descriptors are detailed in @link CBUUID.h @/link. + * + */ +@property(retain, readonly) id value; + +@end + + +/*! + * @class CBMutableDescriptor + * + * @discussion + * Used to create a local characteristic descriptor, which can be added to the local database via CBPeripheralManager. + * Once a descriptor is published, it is cached and can no longer be changed. + * Descriptor types are detailed in @link CBUUID.h @/link, but only the Characteristic User Description and Characteristic Presentation + * Format descriptors are currently supported. The Characteristic Extended Properties and Client Characteristic + * Configuration descriptors will be created automatically upon publication of the parent service, depending on the properties of the characteristic itself. + */ +NS_CLASS_AVAILABLE(NA, 6_0) +CB_EXTERN_CLASS @interface CBMutableDescriptor : CBDescriptor + +/*! + * @method initWithType:value: + * + * @param UUID The Bluetooth UUID of the descriptor. + * @param value The value of the descriptor. + * + * @discussion Returns a decriptor, initialized with a service type and value. The value is required and cannot be updated dynamically + * once the parent service has been published. + * + */ +- (id)initWithType:(CBUUID *)UUID value:(id)value; + +@end diff --git a/CoreBluetooth.framework/Headers/CBError.h b/CoreBluetooth.framework/Headers/CBError.h new file mode 100644 index 0000000..e263341 --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBError.h @@ -0,0 +1,56 @@ +/* + * @file CBError.h + * @framework CoreBluetooth + * + * @discussion The possible errors returned during LE transactions. + * + * @copyright 2011 Apple, Inc. All rights reserved. + */ + +#import + +#import + + +CB_EXTERN NSString * const CBErrorDomain; + +/*! + * @enum CBError + * + * @discussion The possible errors returned during LE transactions. + */ +typedef NS_ENUM(NSInteger, CBError) { + CBErrorUnknown = 0, + CBErrorInvalidParameters NS_ENUM_AVAILABLE(NA, 6_0) = 1, + CBErrorInvalidHandle NS_ENUM_AVAILABLE(NA, 6_0) = 2, + CBErrorNotConnected NS_ENUM_AVAILABLE(NA, 6_0) = 3, + CBErrorOutOfSpace NS_ENUM_AVAILABLE(NA, 6_0) = 4, + CBErrorOperationCancelled NS_ENUM_AVAILABLE(NA, 6_0) = 5, + CBErrorConnectionTimeout NS_ENUM_AVAILABLE(NA, 6_0) = 6, + CBErrorPeripheralDisconnected NS_ENUM_AVAILABLE(NA, 6_0) = 7, + CBErrorUUIDNotAllowed NS_ENUM_AVAILABLE(NA, 6_0) = 8, + CBErrorAlreadyAdvertising NS_ENUM_AVAILABLE(NA, 6_0) = 9 +}; + +CB_EXTERN NSString * const CBATTErrorDomain; + +typedef NS_ENUM(NSInteger, CBATTError) { + CBATTErrorSuccess NS_ENUM_AVAILABLE(NA, 6_0) = 0x00, + CBATTErrorInvalidHandle = 0x01, + CBATTErrorReadNotPermitted = 0x02, + CBATTErrorWriteNotPermitted = 0x03, + CBATTErrorInvalidPdu = 0x04, + CBATTErrorInsufficientAuthentication = 0x05, + CBATTErrorRequestNotSupported = 0x06, + CBATTErrorInvalidOffset = 0x07, + CBATTErrorInsufficientAuthorization = 0x08, + CBATTErrorPrepareQueueFull = 0x09, + CBATTErrorAttributeNotFound = 0x0A, + CBATTErrorAttributeNotLong = 0x0B, + CBATTErrorInsufficientEncryptionKeySize = 0x0C, + CBATTErrorInvalidAttributeValueLength = 0x0D, + CBATTErrorUnlikelyError = 0x0E, + CBATTErrorInsufficientEncryption = 0x0F, + CBATTErrorUnsupportedGroupType = 0x10, + CBATTErrorInsufficientResources = 0x11 +}; diff --git a/CoreBluetooth.framework/Headers/CBPeripheral.h b/CoreBluetooth.framework/Headers/CBPeripheral.h new file mode 100644 index 0000000..6746a6c --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBPeripheral.h @@ -0,0 +1,395 @@ +/* + * @file CBPeripheral.h + * @framework CoreBluetooth + * + * @discussion Representation of a remote peripheral. + * + * @copyright 2011 Apple, Inc. All rights reserved. + */ + +#import + +#import + +/*! + * @enum CBPeripheralState + * + * @discussion Represents the current connection state of a CBPeripheral. + * + */ +typedef NS_ENUM(NSInteger, CBPeripheralState) { + CBPeripheralStateDisconnected = 0, + CBPeripheralStateConnecting, + CBPeripheralStateConnected, +} NS_AVAILABLE(NA, 7_0); + +/*! + * @enum CBCharacteristicWriteType + * + * @discussion Specifies which type of write is to be performed on a CBCharacteristic. + * + */ +typedef NS_ENUM(NSInteger, CBCharacteristicWriteType) { + CBCharacteristicWriteWithResponse = 0, + CBCharacteristicWriteWithoutResponse, +}; + +@protocol CBPeripheralDelegate; +@class CBService, CBCharacteristic, CBDescriptor, CBUUID; + +/*! + * @class CBPeripheral + * + * @discussion Represents a peripheral. + */ +NS_CLASS_AVAILABLE(10_7, 5_0) +CB_EXTERN_CLASS @interface CBPeripheral : NSObject + +/*! + * @property delegate + * + * @discussion The delegate object that will receive peripheral events. + */ +@property(weak, nonatomic) id delegate; + +/*! + * @property UUID + * + * @discussion Once a peripheral has been connected at least once by the system, it is assigned a UUID. This UUID can be stored and later provided to a + * CBCentralManager to retrieve the peripheral. + * + * @deprecated Use the {@link identifier} property instead. + */ +@property(readonly, nonatomic) CFUUIDRef UUID NS_DEPRECATED(NA, NA, 5_0, 7_0); + +/*! + * @property identifier + * + * @discussion The unique identifier associated with the peripheral. This identifier can be stored and later provided to a CBCentralManager + * to retrieve the peripheral. + */ +@property(readonly, nonatomic) NSUUID *identifier; + +/*! + * @property name + * + * @discussion The name of the peripheral. + */ +@property(retain, readonly) NSString *name; + +/*! + * @property RSSI + * + * @discussion The most recently read RSSI, in decibels. + */ +@property(retain, readonly) NSNumber *RSSI; + +/*! + * @property isConnected + * + * @discussion Whether or not the peripheral is currently connected. + * + * @deprecated Use the {@link state} property instead. + */ +@property(readonly) BOOL isConnected NS_DEPRECATED(NA, NA, 5_0, 7_0); + +/*! + * @property state + * + * @discussion The current connection state of the peripheral. + */ +@property(readonly) CBPeripheralState state; + +/*! + * @property services + * + * @discussion A list of CBService objects that have been discovered on the peripheral. + */ +@property(retain, readonly) NSArray *services; + +/*! + * @method readRSSI + * + * @discussion While connected, retrieves the current RSSI of the link. + * + * @see peripheralDidUpdateRSSI:error: + */ +- (void)readRSSI; + +/*! + * @method discoverServices: + * + * @param serviceUUIDs A list of CBUUID objects representing the service types to be discovered. If nil, + * all services will be discovered, which is considerably slower and not recommended. + * + * @discussion Discovers available service(s) on the peripheral. + * + * @see peripheral:didDiscoverServices: + */ +- (void)discoverServices:(NSArray *)serviceUUIDs; + +/*! + * @method discoverIncludedServices:forService: + * + * @param includedServiceUUIDs A list of CBUUID objects representing the included service types to be discovered. If nil, + * all of services included services will be discovered, which is considerably slower and not recommended. + * @param service A GATT service. + * + * @discussion Discovers the specified included service(s) of service. + * + * @see peripheral:didDiscoverIncludedServicesForService:error: + */ +- (void)discoverIncludedServices:(NSArray *)includedServiceUUIDs forService:(CBService *)service; + +/*! + * @method discoverCharacteristics:forService: + * + * @param characteristicUUIDs A list of CBUUID objects representing the characteristic types to be discovered. If nil, + * all characteristics of service will be discovered, which is considerably slower and not recommended. + * @param service A GATT service. + * + * @discussion Discovers the specified characteristic(s) of service. + * + * @see peripheral:didDiscoverCharacteristicsForService:error: + */ +- (void)discoverCharacteristics:(NSArray *)characteristicUUIDs forService:(CBService *)service; + +/*! + * @method readValueForCharacteristic: + * + * @param characteristic A GATT characteristic. + * + * @discussion Reads the characteristic value for characteristic. + * + * @see peripheral:didUpdateValueForCharacteristic:error: + */ +- (void)readValueForCharacteristic:(CBCharacteristic *)characteristic; + +/*! + * @method writeValue:forCharacteristic:type: + * + * @param data The value to write. + * @param characteristic The characteristic whose characteristic value will be written. + * @param type The type of write to be executed. + * + * @discussion Writes value to characteristic's characteristic value. If the CBCharacteristicWriteWithResponse + * type is specified, {@link peripheral:didWriteValueForCharacteristic:error:} is called with the result of the write request. + * + * @see peripheral:didWriteValueForCharacteristic:error: + * @see CBCharacteristicWriteType + */ +- (void)writeValue:(NSData *)data forCharacteristic:(CBCharacteristic *)characteristic type:(CBCharacteristicWriteType)type; + +/*! + * @method setNotifyValue:forCharacteristic: + * + * @param enabled Whether or not notifications/indications should be enabled. + * @param characteristic The characteristic containing the client characteristic configuration descriptor. + * + * @discussion Enables or disables notifications/indications for the characteristic value of characteristic. If characteristic + * allows both, notifications will be used. + * When notifications/indications are enabled, updates to the characteristic value will be received via delegate method + * @link peripheral:didUpdateValueForCharacteristic:error: @/link. Since it is the peripheral that chooses when to send an update, + * the application should be prepared to handle them as long as notifications/indications remain enabled. + * + * @see peripheral:didUpdateNotificationStateForCharacteristic:error: + * @seealso CBConnectPeripheralOptionNotifyOnNotificationKey + */ +- (void)setNotifyValue:(BOOL)enabled forCharacteristic:(CBCharacteristic *)characteristic; + +/*! + * @method discoverDescriptorsForCharacteristic: + * + * @param characteristic A GATT characteristic. + * + * @discussion Discovers the characteristic descriptor(s) of characteristic. + * + * @see peripheral:didDiscoverDescriptorsForCharacteristic:error: + */ +- (void)discoverDescriptorsForCharacteristic:(CBCharacteristic *)characteristic; + +/*! + * @method readValueForDescriptor: + * + * @param descriptor A GATT characteristic descriptor. + * + * @discussion Reads the value of descriptor. + * + * @see peripheral:didUpdateValueForDescriptor:error: + */ +- (void)readValueForDescriptor:(CBDescriptor *)descriptor; + +/*! + * @method writeValue:forDescriptor: + * + * @param data The value to write. + * @param descriptor A GATT characteristic descriptor. + * + * @discussion Writes data to descriptor's value. Client characteristic configuration descriptors cannot be written using + * this method, and should instead use @link setNotifyValue:forCharacteristic: @/link. + * + * @see peripheral:didWriteValueForCharacteristic:error: + */ +- (void)writeValue:(NSData *)data forDescriptor:(CBDescriptor *)descriptor; + +@end + + + +/*! + * @protocol CBPeripheralDelegate + * + * @discussion Delegate for CBPeripheral. + * + */ +@protocol CBPeripheralDelegate + +@optional + +/*! + * @method peripheralDidUpdateName: + * + * @param peripheral The peripheral providing this update. + * + * @discussion This method is invoked when the @link name @/link of peripheral changes. + */ +- (void)peripheralDidUpdateName:(CBPeripheral *)peripheral NS_AVAILABLE(NA, 6_0); + +/*! + * @method peripheralDidInvalidateServices: + * + * @param peripheral The peripheral providing this update. + * + * @discussion This method is invoked when the @link services @/link of peripheral have been changed. At this point, + * all existing CBService objects are invalidated. Services can be re-discovered via @link discoverServices: @/link. + * + * @deprecated Use {@link peripheral:didModifyServices:} instead. + */ +- (void)peripheralDidInvalidateServices:(CBPeripheral *)peripheral NS_DEPRECATED(NA, NA, 6_0, 7_0); + +/*! + * @method peripheral:didModifyServices: + * + * @param peripheral The peripheral providing this update. + * @param invalidatedServices The services that have been invalidated + * + * @discussion This method is invoked when the @link services @/link of peripheral have been changed. + * At this point, the designated CBService objects have been invalidated. + * Services can be re-discovered via @link discoverServices: @/link. + */ +- (void)peripheral:(CBPeripheral *)peripheral didModifyServices:(NSArray *)invalidatedServices NS_AVAILABLE(NA, 7_0); + +/*! + * @method peripheralDidUpdateRSSI:error: + * + * @param peripheral The peripheral providing this update. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of a @link readRSSI: @/link call. + */ +- (void)peripheralDidUpdateRSSI:(CBPeripheral *)peripheral error:(NSError *)error; + +/*! + * @method peripheral:didDiscoverServices: + * + * @param peripheral The peripheral providing this information. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of a @link discoverServices: @/link call. If the service(s) were read successfully, they can be retrieved via + * peripheral's @link services @/link property. + * + */ +- (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error; + +/*! + * @method peripheral:didDiscoverIncludedServicesForService:error: + * + * @param peripheral The peripheral providing this information. + * @param service The CBService object containing the included services. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of a @link discoverIncludedServices:forService: @/link call. If the included service(s) were read successfully, + * they can be retrieved via service's includedServices property. + */ +- (void)peripheral:(CBPeripheral *)peripheral didDiscoverIncludedServicesForService:(CBService *)service error:(NSError *)error; + +/*! + * @method peripheral:didDiscoverCharacteristicsForService:error: + * + * @param peripheral The peripheral providing this information. + * @param service The CBService object containing the characteristic(s). + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of a @link discoverCharacteristics:forService: @/link call. If the characteristic(s) were read successfully, + * they can be retrieved via service's characteristics property. + */ +- (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error; + +/*! + * @method peripheral:didUpdateValueForCharacteristic:error: + * + * @param peripheral The peripheral providing this information. + * @param characteristic A CBCharacteristic object. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method is invoked after a @link readValueForCharacteristic: @/link call, or upon receipt of a notification/indication. + */ +- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error; + +/*! + * @method peripheral:didWriteValueForCharacteristic:error: + * + * @param peripheral The peripheral providing this information. + * @param characteristic A CBCharacteristic object. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of a {@link writeValue:forCharacteristic:type:} call, when the CBCharacteristicWriteWithResponse type is used. + */ + - (void)peripheral:(CBPeripheral *)peripheral didWriteValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error; + +/*! + * @method peripheral:didUpdateNotificationStateForCharacteristic:error: + * + * @param peripheral The peripheral providing this information. + * @param characteristic A CBCharacteristic object. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of a @link setNotifyValue:forCharacteristic: @/link call. + */ +- (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error; + +/*! + * @method peripheral:didDiscoverDescriptorsForCharacteristic:error: + * + * @param peripheral The peripheral providing this information. + * @param characteristic A CBCharacteristic object. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of a @link discoverDescriptorsForCharacteristic: @/link call. If the descriptors were read successfully, + * they can be retrieved via characteristic's descriptors property. + */ +- (void)peripheral:(CBPeripheral *)peripheral didDiscoverDescriptorsForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error; + +/*! + * @method peripheral:didUpdateValueForDescriptor:error: + * + * @param peripheral The peripheral providing this information. + * @param descriptor A CBDescriptor object. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of a @link readValueForDescriptor: @/link call. + */ +- (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForDescriptor:(CBDescriptor *)descriptor error:(NSError *)error; + +/*! + * @method peripheral:didWriteValueForDescriptor:error: + * + * @param peripheral The peripheral providing this information. + * @param descriptor A CBDescriptor object. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of a @link writeValue:forDescriptor: @/link call. + */ +- (void)peripheral:(CBPeripheral *)peripheral didWriteValueForDescriptor:(CBDescriptor *)descriptor error:(NSError *)error; + +@end diff --git a/CoreBluetooth.framework/Headers/CBPeripheralManager.h b/CoreBluetooth.framework/Headers/CBPeripheralManager.h new file mode 100644 index 0000000..93a85ae --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBPeripheralManager.h @@ -0,0 +1,412 @@ +/* + * @file CBPeripheralManager.h + * @framework CoreBluetooth + * + * @discussion Entry point to the peripheral role. + * + * @copyright 2012 Apple, Inc. All rights reserved. + */ + +#import +#import +#import +#import + +/*! + * @enum CBPeripheralManagerAuthorizationStatus + * + * @discussion Represents the current state of a CBPeripheralManager. + * + * @constant CBPeripheralManagerAuthorizationStatusNotDetermined User has not yet made a choice with regards to this application. + * @constant CBPeripheralManagerAuthorizationStatusRestricted This application is not authorized to share data while backgrounded. The user cannot change this application’s status, possibly due to active restrictions such as parental controls being in place. + * @constant CBPeripheralManagerAuthorizationStatusDenied User has explicitly denied this application from sharing data while backgrounded. + * @constant CBPeripheralManagerAuthorizationStatusAuthorized User has authorized this application to share data while backgrounded. + * + */ +typedef NS_ENUM(NSInteger, CBPeripheralManagerAuthorizationStatus) { + CBPeripheralManagerAuthorizationStatusNotDetermined = 0, + CBPeripheralManagerAuthorizationStatusRestricted, + CBPeripheralManagerAuthorizationStatusDenied, + CBPeripheralManagerAuthorizationStatusAuthorized, +} NS_ENUM_AVAILABLE(NA, 7_0); + +/*! + * @enum CBPeripheralManagerState + * + * @discussion Represents the current state of a CBPeripheralManager. + * + * @constant CBPeripheralManagerStateUnknown State unknown, update imminent. + * @constant CBPeripheralManagerStateResetting The connection with the system service was momentarily lost, update imminent. + * @constant CBPeripheralManagerStateUnsupported The platform doesn't support the Bluetooth Low Energy Peripheral/Server role. + * @constant CBPeripheralManagerStateUnauthorized The application is not authorized to use the Bluetooth Low Energy Peripheral/Server role. + * @constant CBPeripheralManagerStatePoweredOff Bluetooth is currently powered off. + * @constant CBPeripheralManagerStatePoweredOn Bluetooth is currently powered on and available to use. + * + */ +typedef NS_ENUM(NSInteger, CBPeripheralManagerState) { + CBPeripheralManagerStateUnknown = 0, + CBPeripheralManagerStateResetting, + CBPeripheralManagerStateUnsupported, + CBPeripheralManagerStateUnauthorized, + CBPeripheralManagerStatePoweredOff, + CBPeripheralManagerStatePoweredOn, +} NS_ENUM_AVAILABLE(NA, 6_0); + +/*! + * @enum CBPeripheralManagerConnectionLatency + * + * @discussion The latency of a peripheral-central connection controls how frequently messages can be exchanged. + * + * @constant CBPeripheralManagerConnectionLatencyLow Prioritizes rapid communication over battery life. + * @constant CBPeripheralManagerConnectionLatencyMedium A balance between communication frequency and battery life. + * @constant CBPeripheralManagerConnectionLatencyHigh Prioritizes extending battery life over rapid communication. + * + */ +typedef NS_ENUM(NSInteger, CBPeripheralManagerConnectionLatency) { + CBPeripheralManagerConnectionLatencyLow = 0, + CBPeripheralManagerConnectionLatencyMedium, + CBPeripheralManagerConnectionLatencyHigh +} NS_ENUM_AVAILABLE(NA, 6_0); + + +@class CBCentral, CBService, CBMutableService, CBCharacteristic, CBMutableCharacteristic, CBATTRequest; +@protocol CBPeripheralManagerDelegate; + +/*! + * @class CBPeripheralManager + * + * @discussion The CBPeripheralManager class is an abstraction of the Peripheral and Broadcaster GAP roles, and the GATT Server + * role. Its primary function is to allow you to manage published services within the GATT database, and to advertise these services + * to other devices. + * Each application has sandboxed access to the shared GATT database. You can add services to the database by calling {@link addService:}; + * they can be removed via {@link removeService:} and {@link removeAllServices}, as appropriate. While a service is in the database, + * it is visible to and can be accessed by any connected GATT Client. However, applications that have not specified the "bluetooth-peripheral" + * background mode will have the contents of their service(s) "disabled" when in the background. Any remote device trying to access + * characteristic values or descriptors during this time will receive an error response. + * Once you've published services that you want to share, you can ask to advertise their availability and allow other devices to connect + * to you by calling {@link startAdvertising:}. Like the GATT database, advertisement is managed at the system level and shared by all + * applications. This means that even if you aren't advertising at the moment, someone else might be! + * + */ +NS_CLASS_AVAILABLE(NA, 6_0) +CB_EXTERN_CLASS @interface CBPeripheralManager : NSObject + +/*! + * @property delegate + * + * @discussion The delegate object that will receive peripheral events. + * + */ +@property(weak, nonatomic) id delegate; + +/*! + * @property state + * + * @discussion The current state of the peripheral, initially set to CBPeripheralManagerStateUnknown. Updates are provided by required + * delegate method @link peripheralManagerDidUpdateState: @/link. + * + */ +@property(readonly) CBPeripheralManagerState state; + +/*! + * @property isAdvertising + * + * @discussion Whether or not the peripheral is currently advertising data. + * + */ +@property(readonly) BOOL isAdvertising; + +/*! + * @method authorizationStatus + * + * @discussion This method does not prompt the user for access. You can use it to detect restricted access and simply hide UI instead of + * prompting for access. + * + * @return The current authorization status for sharing data while backgrounded. For the constants returned, see {@link CBPeripheralManagerAuthorizationStatus}. + * + * @see CBPeripheralManagerAuthorizationStatus + */ ++ (CBPeripheralManagerAuthorizationStatus)authorizationStatus NS_AVAILABLE(NA, 7_0); + +/*! + * @method initWithDelegate:queue: + * + * @param delegate The delegate that will receive peripheral role events. + * @param queue The dispatch queue on which the events will be dispatched. + * + * @discussion The initialization call. The events of the peripheral role will be dispatched on the provided queue. + * If nil, the main queue will be used. + * + */ +- (id)initWithDelegate:(id)delegate queue:(dispatch_queue_t)queue; + +/*! + * @method initWithDelegate:queue:options: + * + * @param delegate The delegate that will receive peripheral role events. + * @param queue The dispatch queue on which the events will be dispatched. + * @param options An optional dictionary specifying options for the manager. + * + * @discussion The initialization call. The events of the peripheral role will be dispatched on the provided queue. + * If nil, the main queue will be used. + * + * @seealso CBPeripheralManagerOptionShowPowerAlertKey + * @seealso CBPeripheralManagerOptionRestoreIdentifierKey + * + */ +- (id)initWithDelegate:(id)delegate queue:(dispatch_queue_t)queue options:(NSDictionary *)options NS_AVAILABLE(NA, 7_0); + +/*! + * @method startAdvertising: + * + * @param advertisementData An optional dictionary containing the data to be advertised. + * + * @discussion Starts advertising. Supported advertising data types are CBAdvertisementDataLocalNameKey + * and CBAdvertisementDataServiceUUIDsKey. + * When in the foreground, an application can utilize up to 28 bytes of space in the initial advertisement data for + * any combination of the supported advertising data types. If this space is used up, there are an additional 10 bytes of + * space in the scan response that can be used only for the local name. Note that these sizes do not include the 2 bytes + * of header information that are required for each new data type. Any service UUIDs that do not fit in the allotted space + * will be added to a special "overflow" area, and can only be discovered by an iOS device that is explicitly scanning + * for them. + * While an application is in the background, the local name will not be used and all service UUIDs will be placed in the + * "overflow" area. However, applications that have not specified the "bluetooth-peripheral" background mode will not be able + * to advertise anything while in the background. + * + * @see peripheralManagerDidStartAdvertising:error: + * @seealso CBAdvertisementData.h + * + */ +- (void)startAdvertising:(NSDictionary *)advertisementData; + +/*! + * @method stopAdvertising + * + * @discussion Stops advertising. + * + */ +- (void)stopAdvertising; + +/*! + * @method setDesiredConnectionLatency:forCentral: + * + * @param latency The desired connection latency. + * @param central A connected central. + * + * @discussion Sets the desired connection latency for an existing connection to central. Connection latency changes are not guaranteed, so the + * resultant latency may vary. If a desired latency is not set, the latency chosen by central at the time of connection establishment + * will be used. Typically, it is not necessary to change the latency. + * + * @see CBPeripheralManagerConnectionLatency + * + */ +- (void)setDesiredConnectionLatency:(CBPeripheralManagerConnectionLatency)latency forCentral:(CBCentral *)central; + +/*! + * @method addService: + * + * @param service A GATT service. + * + * @discussion Publishes a service and its associated characteristic(s) to the local database. If the service contains included services, + * they must be published first. + * + * @see peripheralManager:didAddService:error: + */ +- (void)addService:(CBMutableService *)service; + +/*! + * @method removeService: + * + * @param service A GATT service. + * + * @discussion Removes a published service from the local database. If the service is included by other service(s), they must be removed + * first. + * + */ +- (void)removeService:(CBMutableService *)service; + +/*! + * @method removeAllServices + * + * @discussion Removes all published services from the local database. + * + */ +- (void)removeAllServices; + +/*! + * @method respondToRequest:withResult: + * + * @param request The original request that was received from the central. + * @param result The result of attempting to fulfill request. + * + * @discussion Used to respond to request(s) received via the @link peripheralManager:didReceiveReadRequest: @/link or + * @link peripheralManager:didReceiveWriteRequests: @/link delegate methods. + * + * @see peripheralManager:didReceiveReadRequest: + * @see peripheralManager:didReceiveWriteRequests: + */ +- (void)respondToRequest:(CBATTRequest *)request withResult:(CBATTError)result; + +/*! + * @method updateValue:forCharacteristic:onSubscribedCentrals: + * + * @param value The value to be sent via a notification/indication. + * @param characteristic The characteristic whose value has changed. + * @param centrals A list of CBCentral objects to receive the update. Note that centrals which have not subscribed to + * characteristic will be ignored. If nil, all centrals that are subscribed to characteristic will be updated. + * + * @discussion Sends an updated characteristic value to one or more centrals, via a notification or indication. If value exceeds + * {@link maximumUpdateValueLength}, it will be truncated to fit. + * + * @return YES if the update could be sent, or NO if the underlying transmit queue is full. If NO was returned, + * the delegate method @link peripheralManagerIsReadyToUpdateSubscribers: @/link will be called once space has become + * available, and the update should be re-sent if so desired. + * + * @see peripheralManager:central:didSubscribeToCharacteristic: + * @see peripheralManager:central:didUnsubscribeFromCharacteristic: + * @see peripheralManagerIsReadyToUpdateSubscribers: + * @seealso maximumUpdateValueLength + */ +- (BOOL)updateValue:(NSData *)value forCharacteristic:(CBMutableCharacteristic *)characteristic onSubscribedCentrals:(NSArray *)centrals; + +@end + + +/*! + * @protocol CBPeripheralManagerDelegate + * + * @discussion The delegate of a @link CBPeripheralManager @/link object must adopt the CBPeripheralManagerDelegate protocol. The + * single required method indicates the availability of the peripheral manager, while the optional methods provide information about + * centrals, which can connect and access the local database. + * + */ +@protocol CBPeripheralManagerDelegate + +@required + +/*! + * @method peripheralManagerDidUpdateState: + * + * @param peripheral The peripheral manager whose state has changed. + * + * @discussion Invoked whenever the peripheral manager's state has been updated. Commands should only be issued when the state is + * CBPeripheralManagerStatePoweredOn. A state below CBPeripheralManagerStatePoweredOn + * implies that advertisement has paused and any connected centrals have been disconnected. If the state moves below + * CBPeripheralManagerStatePoweredOff, advertisement is stopped and must be explicitly restarted, and the + * local database is cleared and all services must be re-added. + * + * @see state + * + */ +- (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral; + +@optional + +/*! + * @method peripheralManager:willRestoreState: + * + * @param peripheral The peripheral manager providing this information. + * @param dict A dictionary containing information about peripheral that was preserved by the system at the time the app was terminated. + * + * @discussion For apps that opt-in to state preservation and restoration, this is the first method invoked when your app is relaunched into + * the background to complete some Bluetooth-related task. Use this method to synchronize your app's state with the state of the + * Bluetooth system. + * + * @seealso CBPeripheralManagerRestoredStateServicesKey; + * @seealso CBPeripheralManagerRestoredStateAdvertisementDataKey; + * + */ +- (void)peripheralManager:(CBPeripheralManager *)peripheral willRestoreState:(NSDictionary *)dict; + +/*! + * @method peripheralManagerDidStartAdvertising:error: + * + * @param peripheral The peripheral manager providing this information. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of a @link startAdvertising: @/link call. If advertisement could + * not be started, the cause will be detailed in the error parameter. + * + */ +- (void)peripheralManagerDidStartAdvertising:(CBPeripheralManager *)peripheral error:(NSError *)error; + +/*! + * @method peripheralManager:didAddService:error: + * + * @param peripheral The peripheral manager providing this information. + * @param service The service that was added to the local database. + * @param error If an error occurred, the cause of the failure. + * + * @discussion This method returns the result of an @link addService: @/link call. If the service could + * not be published to the local database, the cause will be detailed in the error parameter. + * + */ +- (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(NSError *)error; + +/*! + * @method peripheralManager:central:didSubscribeToCharacteristic: + * + * @param peripheral The peripheral manager providing this update. + * @param central The central that issued the command. + * @param characteristic The characteristic on which notifications or indications were enabled. + * + * @discussion This method is invoked when a central configures characteristic to notify or indicate. + * It should be used as a cue to start sending updates as the characteristic value changes. + * + */ +- (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central didSubscribeToCharacteristic:(CBCharacteristic *)characteristic; + +/*! + * @method peripheralManager:central:didUnsubscribeFromCharacteristic: + * + * @param peripheral The peripheral manager providing this update. + * @param central The central that issued the command. + * @param characteristic The characteristic on which notifications or indications were disabled. + * + * @discussion This method is invoked when a central removes notifications/indications from characteristic. + * + */ +- (void)peripheralManager:(CBPeripheralManager *)peripheral central:(CBCentral *)central didUnsubscribeFromCharacteristic:(CBCharacteristic *)characteristic; + +/*! + * @method peripheralManager:didReceiveReadRequest: + * + * @param peripheral The peripheral manager requesting this information. + * @param request A CBATTRequest object. + * + * @discussion This method is invoked when peripheral receives an ATT request for a characteristic with a dynamic value. + * For every invocation of this method, @link respondToRequest:withResult: @/link must be called. + * + * @see CBATTRequest + * + */ +- (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveReadRequest:(CBATTRequest *)request; + +/*! + * @method peripheralManager:didReceiveWriteRequests: + * + * @param peripheral The peripheral manager requesting this information. + * @param requests A list of one or more CBATTRequest objects. + * + * @discussion This method is invoked when peripheral receives an ATT request or command for one or more characteristics with a dynamic value. + * For every invocation of this method, @link respondToRequest:withResult: @/link should be called exactly once. If requests contains + * multiple requests, they must be treated as an atomic unit. If the execution of one of the requests would cause a failure, the request + * and error reason should be provided to respondToRequest:withResult: and none of the requests should be executed. + * + * @see CBATTRequest + * + */ +- (void)peripheralManager:(CBPeripheralManager *)peripheral didReceiveWriteRequests:(NSArray *)requests; + +/*! + * @method peripheralManagerIsReadyToUpdateSubscribers: + * + * @param peripheral The peripheral manager providing this update. + * + * @discussion This method is invoked after a failed call to @link updateValue:forCharacteristic:onSubscribedCentrals: @/link, when peripheral is again + * ready to send characteristic value updates. + * + */ +- (void)peripheralManagerIsReadyToUpdateSubscribers:(CBPeripheralManager *)peripheral; + +@end diff --git a/CoreBluetooth.framework/Headers/CBPeripheralManagerConstants.h b/CoreBluetooth.framework/Headers/CBPeripheralManagerConstants.h new file mode 100644 index 0000000..9a22b0b --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBPeripheralManagerConstants.h @@ -0,0 +1,57 @@ +/* + * @file CBPeripheralManagerConstants.h + * @framework CoreBluetooth + * + * @copyright 2013 Apple, Inc. All rights reserved. + */ + +#import +#import + +/*! + * @const CBPeripheralManagerOptionShowPowerAlertKey + * + * @discussion A NSNumber (Boolean) indicating that the system should, if Bluetooth is powered off when CBPeripheralManager is instantiated, display + * a warning dialog to the user. + * + * @see initWithDelegate:queue:options: + * + */ +CB_EXTERN NSString * const CBPeripheralManagerOptionShowPowerAlertKey NS_AVAILABLE(NA, 7_0); + +/*! + * @const CBPeripheralManagerOptionRestoreIdentifierKey + * + * @discussion A NSString containing a unique identifier (UID) for the CBPeripheralManager that is being instantiated. This UID is used + * by the system to identify a specific CBPeripheralManager instance for restoration and, therefore, must remain the same for + * subsequent application executions in order for the manager to be restored. + * + * @see initWithDelegate:queue:options: + * @seealso centralManager:willRestoreState: + * + */ +CB_EXTERN NSString * const CBPeripheralManagerOptionRestoreIdentifierKey NS_AVAILABLE(NA, 7_0); + +/*! + * @const CBPeripheralManagerRestoredStateServicesKey + * + * @discussion An NSArray of CBMutableService objects containing all services that were published to the local database at the time the + * application was terminated by the system. All information for each service will be restored, including all discovered + * services, characteristics and descriptors, as well as characteristic notification states. + * + * @see peripheralManager:willRestoreState: + * @seealso addService: + * + */ +CB_EXTERN NSString * const CBPeripheralManagerRestoredStateServicesKey NS_AVAILABLE(NA, 7_0); + +/*! + * @const CBPeripheralManagerRestoredStateAdvertisementDataKey + * + * @discussion A NSDictionary containing the data being advertised at the time the application was terminated by the system. + * + * @see peripheralManager:willRestoreState: + * @seealso startAdvertising: + * + */ +CB_EXTERN NSString * const CBPeripheralManagerRestoredStateAdvertisementDataKey NS_AVAILABLE(NA, 7_0); diff --git a/CoreBluetooth.framework/Headers/CBService.h b/CoreBluetooth.framework/Headers/CBService.h new file mode 100644 index 0000000..942705b --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBService.h @@ -0,0 +1,105 @@ +/* + * @file CBService.h + * @framework CoreBluetooth + * + * @discussion A Bluetooth LE service representation. A LE Service provides a number of + * characteristics and may also reference other services. + * + * @copyright 2011 Apple, Inc. All rights reserved. + */ + +#import + +#import + + + +@class CBPeripheral, CBUUID; + +/*! + * @class CBService + * + * @discussion + * Represents a peripheral's service or a service's included service. + * + */ +NS_CLASS_AVAILABLE(10_7, 5_0) +CB_EXTERN_CLASS @interface CBService : NSObject + +/*! + * @property peripheral + * + * @discussion + * A back-pointer to the peripheral this service belongs to. + * + */ +@property(weak, readonly, nonatomic) CBPeripheral *peripheral; + +/*! + * @property UUID + * + * @discussion + * The Bluetooth UUID of the service. + * + */ +@property(readonly, nonatomic) CBUUID *UUID; + +/*! + * @property isPrimary + * + * @discussion + * The type of the service (primary or secondary). + * + */ +@property(readonly, nonatomic) BOOL isPrimary; + +/*! + * @property includedServices + * + * @discussion + * A list of included CBServices that have so far been discovered in this service. + * + */ +@property(retain, readonly) NSArray *includedServices; + +/*! + * @property characteristics + * + * @discussion + * A list of CBCharacteristics that have so far been discovered in this service. + * + */ +@property(retain, readonly) NSArray *characteristics; + +@end + + +/*! + * @class CBMutableService + * + * @discussion + * Used to create a local service or included service, which can be added to the local database via CBPeripheralManager. + * Once a service is published, it is cached and can no longer be changed. This class adds write access to all properties in the + * @link CBService @/link class. + * + */ +NS_CLASS_AVAILABLE(NA, 6_0) +CB_EXTERN_CLASS @interface CBMutableService : CBService + +@property(retain, readwrite, nonatomic) CBUUID *UUID; +@property(readwrite, nonatomic) BOOL isPrimary; +@property(retain, readwrite) NSArray *includedServices; +@property(retain, readwrite) NSArray *characteristics; + +/*! + * @method initWithType:primary: + * + * @param UUID The Bluetooth UUID of the service. + * @param isPrimary The type of the service (primary or secondary). + * + * @discussion Returns a service, initialized with a service type and UUID. + * + */ +- (id)initWithType:(CBUUID *)UUID primary:(BOOL)isPrimary; + +@end diff --git a/CoreBluetooth.framework/Headers/CBUUID.h b/CoreBluetooth.framework/Headers/CBUUID.h new file mode 100644 index 0000000..dd1f8ba --- /dev/null +++ b/CoreBluetooth.framework/Headers/CBUUID.h @@ -0,0 +1,154 @@ +/* + * @file CBUUID.h + * @framework CoreBluetooth + * + * @discussion The CBUUID class represents bluetooth LE UUIDs. It automatically handles + * transformations of 16 and 32 bit UUIDs into 128 bit UUIDs. + * + * @copyright 2011 Apple, Inc. All rights reserved. + */ + +#import + +#import + +/*! + * @const CBUUIDCharacteristicExtendedPropertiesString + * @discussion The string representation of the UUID for the extended properties descriptor. + * The corresponding value for this descriptor is an NSNumber object. + */ +CB_EXTERN NSString * const CBUUIDCharacteristicExtendedPropertiesString; +/*! + * @const CBUUIDCharacteristicUserDescriptionString + * @discussion The string representation of the UUID for the user description descriptor. + * The corresponding value for this descriptor is an NSString object. + */ +CB_EXTERN NSString * const CBUUIDCharacteristicUserDescriptionString; +/*! + * @const CBUUIDClientCharacteristicConfigurationString + * @discussion The string representation of the UUID for the client configuration descriptor. + * The corresponding value for this descriptor is an NSNumber object. + */ +CB_EXTERN NSString * const CBUUIDClientCharacteristicConfigurationString; +/*! + * @const CBUUIDServerCharacteristicConfigurationString + * @discussion The string representation of the UUID for the server configuration descriptor. + * The corresponding value for this descriptor is an NSNumber object. + */ +CB_EXTERN NSString * const CBUUIDServerCharacteristicConfigurationString; +/*! + * @const CBUUIDCharacteristicFormatString + * @discussion The string representation of the UUID for the presentation format descriptor. + * The corresponding value for this descriptor is an NSData object. + */ +CB_EXTERN NSString * const CBUUIDCharacteristicFormatString; +/*! + * @const CBUUIDCharacteristicAggregateFormatString + * @discussion The string representation of the UUID for the aggregate descriptor. + */ +CB_EXTERN NSString * const CBUUIDCharacteristicAggregateFormatString; + + + +/*! + * @const CBUUIDGenericAccessProfileString + * @discussion The string representation of the GAP UUID. + */ +CB_EXTERN NSString * const CBUUIDGenericAccessProfileString NS_DEPRECATED(NA, NA, 5_0, 7_0); +/*! + * @const CBUUIDGenericAttributeProfileString + * @discussion The string representation of the GATT UUID. + */ +CB_EXTERN NSString * const CBUUIDGenericAttributeProfileString NS_DEPRECATED(NA, NA, 5_0, 7_0); + +/*! + * @const CBUUIDDeviceNameString + * @discussion The string representation of the GAP device name UUID. + */ +CB_EXTERN NSString * const CBUUIDDeviceNameString NS_DEPRECATED(NA, NA, 5_0, 7_0); +/*! + * @const CBUUIDAppearanceString + * @discussion The string representation of the GAP appearance UUID. + */ +CB_EXTERN NSString * const CBUUIDAppearanceString NS_DEPRECATED(NA, NA, 5_0, 7_0); +/*! + * @const CBUUIDPeripheralPrivacyFlagString + * @discussion The string representation of the GAP privacy flag UUID. + */ +CB_EXTERN NSString * const CBUUIDPeripheralPrivacyFlagString NS_DEPRECATED(NA, NA, 5_0, 7_0); +/*! + * @const CBUUIDReconnectionAddressString + * @discussion The string representation of the GAP reconnection address UUID. + */ +CB_EXTERN NSString * const CBUUIDReconnectionAddressString NS_DEPRECATED(NA, NA, 5_0, 7_0); +/*! + * @const CBUUIDPeripheralPreferredConnectionParametersString + * @discussion The string representation of the GAP preferred connection parameter UUID. + */ +CB_EXTERN NSString * const CBUUIDPeripheralPreferredConnectionParametersString NS_DEPRECATED(NA, NA, 5_0, 7_0); +/*! + * @const CBUUIDServiceChangedString + * @discussion The string representation of the GATT service changed UUID. + */ +CB_EXTERN NSString * const CBUUIDServiceChangedString NS_DEPRECATED(NA, NA, 5_0, 7_0); + + + +/*! + * @class CBUUID + * + * @discussion + * A 16-bit or 128-bit Bluetooth UUID. + * 16-bit UUIDs are implicitly pre-filled with the Bluetooth Base UUID. + * + */ +NS_CLASS_AVAILABLE(10_7, 5_0) +CB_EXTERN_CLASS @interface CBUUID : NSObject + +/*! + * @property data + * + * @discussion + * The UUID as NSData. + * + */ +@property(nonatomic, readonly) NSData *data; + +/*! + * @method UUIDWithString: + * + * @discussion + * Creates a CBUUID with a 16-bit or 128-bit UUID string representation. + * The expected format for 128-bit UUIDs is a string punctuated by hyphens, for example 68753A44-4D6F-1226-9C60-0050E4C00067. + * + */ ++ (CBUUID *)UUIDWithString:(NSString *)theString; + +/*! + * @method UUIDWithData: + * + * @discussion + * Creates a CBUUID with a 16-bit or 128-bit UUID data container. + * + */ ++ (CBUUID *)UUIDWithData:(NSData *)theData; + +/*! + * @method UUIDWithCFUUID: + * + * @discussion + * Creates a CBUUID with a CFUUIDRef. + * + */ ++ (CBUUID *)UUIDWithCFUUID:(CFUUIDRef)theUUID; + +/*! + * @method UUIDWithNSUUID: + * + * @discussion + * Creates a CBUUID with a NSUUID. + * + */ ++ (CBUUID *)UUIDWithNSUUID:(NSUUID *)theUUID NS_AVAILABLE(NA, 7_0); + +@end diff --git a/CoreBluetooth.framework/Headers/CoreBluetooth.h b/CoreBluetooth.framework/Headers/CoreBluetooth.h new file mode 100644 index 0000000..59a41aa --- /dev/null +++ b/CoreBluetooth.framework/Headers/CoreBluetooth.h @@ -0,0 +1,21 @@ +/*! + * @header + * @file CoreBluetooth.h + * @framework CoreBluetooth + * + * @discussion Bluetooth Low Energy framework + * + * @copyright 2011 Apple, Inc. All rights reserved. + */ + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import diff --git a/CoreLocation.framework/CoreLocation b/CoreLocation.framework/CoreLocation new file mode 100755 index 0000000..cfcd430 Binary files /dev/null and b/CoreLocation.framework/CoreLocation differ diff --git a/CoreLocation.framework/Headers/CLAvailability.h b/CoreLocation.framework/Headers/CLAvailability.h new file mode 100644 index 0000000..ff180ba --- /dev/null +++ b/CoreLocation.framework/Headers/CLAvailability.h @@ -0,0 +1,30 @@ +/* + * CLAvailability.h + * CoreLocation + * + * Copyright 2011 Apple Inc. All rights reserved. + * + */ + +/* +#ifndef __CL_INDIRECT__ +#error "Please #include instead of this file directly." +#endif // __CL_INDIRECT__ +*/ + +#import + +#ifndef __MAC_TBD +#define __MAC_TBD __MAC_NA +#endif + +#ifndef __AVAILABILITY_INTERNAL__MAC_TBD +#define __AVAILABILITY_INTERNAL__MAC_TBD __AVAILABILITY_INTERNAL_UNAVAILABLE +#endif + +#ifdef __cplusplus +#define CL_EXTERN extern "C" __attribute__((visibility ("default"))) +#else +#define CL_EXTERN extern __attribute__((visibility ("default"))) +#endif + diff --git a/CoreLocation.framework/Headers/CLBeaconRegion.h b/CoreLocation.framework/Headers/CLBeaconRegion.h new file mode 100644 index 0000000..da9d6bb --- /dev/null +++ b/CoreLocation.framework/Headers/CLBeaconRegion.h @@ -0,0 +1,195 @@ +/* + * CLBeaconRegion.h + * CoreLocation + * + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + */ + +#import +#import +#import + +/* + * CLBeaconMajorValue + * + * Discussion: + * Type represents the most significant value in a beacon. + * + */ +typedef uint16_t CLBeaconMajorValue; + +/* + * CLBeaconMinorValue + * + * Discussion: + * Type represents the least significant value in a beacon. + * + */ +typedef uint16_t CLBeaconMinorValue; + +/* + * CLBeaconRegion + * + * Discussion: + * A region containing similar beacons. + * + * Such a region can be defined by proximityUUID, major and minor values. + * proximityUUID must be specified. If proximityUUID is only specified, the major and + * minor values will be wildcarded and the region will match any beacons with the same + * proximityUUID. Similarly if only proximityUUID and major value are specified, the minor value will be + * wildcarded and the region will match against any beacons with the same proximityUUID and major + * value. + * + */ +NS_CLASS_AVAILABLE(NA, 7_0) +@interface CLBeaconRegion : CLRegion + +/* + * initWithProximityUUID:identifier: + * + * Discussion: + * Initialize a beacon region with a proximityUUID. Major and minor values will be wildcarded. + * + */ +- (id)initWithProximityUUID:(NSUUID *)proximityUUID identifier:(NSString *)identifier; + +/* + * initWithProximityUUID:major:identifier: + * + * Discussion: + * Initialize a beacon region with an proximityUUID and major value. Minor value will be wildcarded. + * + */ +- (id)initWithProximityUUID:(NSUUID *)proximityUUID major:(CLBeaconMajorValue)major identifier:(NSString *)identifier; + +/* + * initWithProximityUUID:major:minor:identifier: + * + * Discussion: + * Initialize a beacon region identified by an proximityUUID, major and minor values. + * + */ +- (id)initWithProximityUUID:(NSUUID *)proximityUUID major:(CLBeaconMajorValue)major minor:(CLBeaconMinorValue)minor identifier:(NSString *)identifier; + +/* + * peripheralDataWithMeasuredPower: + * + * Discussion: + * This dictionary can be used to advertise the current device as a beacon when + * used in conjunction with CoreBluetooth's CBPeripheralManager startAdvertising: method. + * The dictionary will contain data that represents the current region in addition to a measured power value. + * + * measuredPower is the RSSI of the device observed from one meter in its intended environment. + * This value is optional, but should be specified to achieve the best ranging performance. + * If not specified, it will default to a pre-determined value for the device. + * + */ +- (NSMutableDictionary *)peripheralDataWithMeasuredPower:(NSNumber *)measuredPower; + +/* + * proximityUUID + * + * Discussion: + * Proximity identifier associated with the region. + * + */ +@property (readonly, nonatomic) NSUUID *proximityUUID; + +/* + * major + * + * Discussion: + * Most significant value associated with the region. If a major value wasn't specified, this will be nil. + * + */ +@property (readonly, nonatomic) NSNumber *major; + +/* + * minor + * + * Discussion: + * Least significant value associated with the region. If a minor value wasn't specified, this will be nil. + * + */ +@property (readonly, nonatomic) NSNumber *minor; + +/* + * notifyEntryStateOnDisplay + * + * Discussion: + * App will be launched and the delegate will be notified via locationManager:didDetermineState:forRegion: + * when the device's screen is turned on and the user is in the region. By default, this is NO. + */ +@property (nonatomic, assign) BOOL notifyEntryStateOnDisplay; + +@end + +/* + * CLBeacon + * + * Discussion: + * A single beacon within a CLBeaconRegion. + * + */ +NS_CLASS_AVAILABLE(NA, 7_0) +@interface CLBeacon : NSObject + +/* + * proximityUUID + * + * Discussion: + * Proximity identifier associated with the beacon. + * + */ +@property (readonly, nonatomic) NSUUID *proximityUUID; + +/* + * major + * + * Discussion: + * Most significant value associated with the beacon. + * + */ +@property (readonly, nonatomic) NSNumber *major; + +/* + * minor + * + * Discussion: + * Least significant value associated with the beacon. + * + */ +@property (readonly, nonatomic) NSNumber *minor; + +/* + * proximity + * + * Discussion: + * Proximity of the beacon from the device. + * + */ +@property (readonly, nonatomic) CLProximity proximity; + +/* + * accuracy + * + * Discussion: + * Represents an one sigma horizontal accuracy in meters where the measuring device's location is + * referenced at the beaconing device. This value is heavily subject to variations in an RF environment. + * A negative accuracy value indicates the proximity is unknown. + * + */ +@property (readonly, nonatomic) CLLocationAccuracy accuracy; + +/* + * rssi + * + * Discussion: + * Received signal strength in decibels of the specified beacon. + * This value is an average of the RSSI samples collected since this beacon was last reported. + * + */ +@property (readonly, nonatomic) NSInteger rssi; + +@end diff --git a/CoreLocation.framework/Headers/CLCircularRegion.h b/CoreLocation.framework/Headers/CLCircularRegion.h new file mode 100644 index 0000000..b1eac87 --- /dev/null +++ b/CoreLocation.framework/Headers/CLCircularRegion.h @@ -0,0 +1,59 @@ +/* + * CLCircularRegion.h + * CoreLocation + * + * Copyright (c) 2012 Apple Inc. All rights reserved. + * + */ + +#import +#import +#import +#import + +/* + * CLCircularRegion + * + * Discussion: + * A circular geographic area. + */ +NS_CLASS_AVAILABLE(NA, 7_0) +@interface CLCircularRegion : CLRegion + +/* + * initWithCenter:radius:identifier: + * + * Discussion: + * Initialize a region. center gives the coordinates of center of the region, while radius gives + * the distance in meters between the center and the region's boundary. identifier is a description + * for the region that could be displayed to the user, and ideally should be chosen by the user. + */ +- (id)initWithCenter:(CLLocationCoordinate2D)center + radius:(CLLocationDistance)radius + identifier:(NSString *)identifier; + +/* + * center + * + * Discussion: + * Returns the coordinate of the center of the region. + */ +@property (readonly, nonatomic) CLLocationCoordinate2D center; + +/* + * radius + * + * Discussion: + * Returns the radius of the region. + */ +@property (readonly, nonatomic) CLLocationDistance radius; + +/* + * containsCoordinate: + * + * Discussion: + * Returns YES if the coordinate lies inside the region, and NO otherwise. + */ +- (BOOL)containsCoordinate:(CLLocationCoordinate2D)coordinate; + +@end diff --git a/CoreLocation.framework/Headers/CLError.h b/CoreLocation.framework/Headers/CLError.h new file mode 100644 index 0000000..3052b5c --- /dev/null +++ b/CoreLocation.framework/Headers/CLError.h @@ -0,0 +1,48 @@ + +/* + * CLError.h + * CoreLocation + * + * Copyright (c) 2008-2010 Apple Inc. All rights reserved. + * + */ + +#import +#import + +/* + * CLError + * + * Discussion: + * Error returned as code to NSError from CoreLocation. + */ +enum { + kCLErrorLocationUnknown = 0, // location is currently unknown, but CL will keep trying + kCLErrorDenied, // Access to location or ranging has been denied by the user + kCLErrorNetwork, // general, network-related error + kCLErrorHeadingFailure, // heading could not be determined + kCLErrorRegionMonitoringDenied, // Location region monitoring has been denied by the user + kCLErrorRegionMonitoringFailure, // A registered region cannot be monitored + kCLErrorRegionMonitoringSetupDelayed, // CL could not immediately initialize region monitoring + kCLErrorRegionMonitoringResponseDelayed, // While events for this fence will be delivered, delivery will not occur immediately + kCLErrorGeocodeFoundNoResult, // A geocode request yielded no result + kCLErrorGeocodeFoundPartialResult, // A geocode request yielded a partial result + kCLErrorGeocodeCanceled, // A geocode request was cancelled + kCLErrorDeferredFailed, // Deferred mode failed + kCLErrorDeferredNotUpdatingLocation, // Deferred mode failed because location updates disabled or paused + kCLErrorDeferredAccuracyTooLow, // Deferred mode not supported for the requested accuracy + kCLErrorDeferredDistanceFiltered, // Deferred mode does not support distance filters + kCLErrorDeferredCanceled, // Deferred mode request canceled a previous request + kCLErrorRangingUnavailable, // Ranging cannot be performed + kCLErrorRangingFailure, // General ranging failure +}; +typedef NSInteger CLError; + +/* + * kCLErrorUserInfoAlternateRegionKey + * + * Discussion: + * When an error with code kCLErrorRegionMonitoringResponseDelayed is received, this key may be populated + * in the userInfo dictionary. The value is a CLRegion that the location service can more effectively monitor. + */ +extern NSString *const kCLErrorUserInfoAlternateRegionKey NS_AVAILABLE(10_7, 5_0); diff --git a/CoreLocation.framework/Headers/CLErrorDomain.h b/CoreLocation.framework/Headers/CLErrorDomain.h new file mode 100644 index 0000000..4c75f70 --- /dev/null +++ b/CoreLocation.framework/Headers/CLErrorDomain.h @@ -0,0 +1,18 @@ + +/* + * CLErrorDomain.h + * CoreLocation + * + * Copyright 2008 Apple, Inc. All rights reserved. + * + */ + +#import + +/* + * kCLErrorDomain + * + * Discussion: + * Error returned as the domain to NSError from CoreLocation. + */ +extern NSString *const kCLErrorDomain; diff --git a/CoreLocation.framework/Headers/CLGeocoder.h b/CoreLocation.framework/Headers/CLGeocoder.h new file mode 100644 index 0000000..aa4823f --- /dev/null +++ b/CoreLocation.framework/Headers/CLGeocoder.h @@ -0,0 +1,45 @@ +/* + * CLGeocoder.h + * CoreLocation + * + * Copyright (c) 2010 Apple Inc. All rights reserved. + */ + +#if TARGET_OS_IPHONE + +#import +#import +#import + +@class CLRegion; +@class CLPlacemark; +@class CLGeocoderInternal; + +// geocoding handler, CLPlacemarks are provided in order of most confident to least confident +typedef void (^CLGeocodeCompletionHandler)(NSArray *placemarks, NSError *error); + +NS_CLASS_AVAILABLE(TBD,5_0) +@interface CLGeocoder : NSObject +{ +@private + CLGeocoderInternal *_internal; +} + +@property (nonatomic, readonly, getter=isGeocoding) BOOL geocoding; + +// reverse geocode requests +- (void)reverseGeocodeLocation:(CLLocation *)location completionHandler:(CLGeocodeCompletionHandler)completionHandler; + +// forward geocode requests +// geocodeAddressDictionary:completionHandler: takes an address dictionary as defined by the AddressBook framework. +// You can obtain an address dictionary from an ABPerson by retrieving the kABPersonAddressProperty property. +// Alternately, one can be constructed using the kABPersonAddress* keys defined in . + +- (void)geocodeAddressDictionary:(NSDictionary *)addressDictionary completionHandler:(CLGeocodeCompletionHandler)completionHandler; +- (void)geocodeAddressString:(NSString *)addressString completionHandler:(CLGeocodeCompletionHandler)completionHandler; +- (void)geocodeAddressString:(NSString *)addressString inRegion:(CLRegion *)region completionHandler:(CLGeocodeCompletionHandler)completionHandler; + +- (void)cancelGeocode; + +@end +#endif //TARGET_OS_IPHONE diff --git a/CoreLocation.framework/Headers/CLHeading.h b/CoreLocation.framework/Headers/CLHeading.h new file mode 100644 index 0000000..cf5c56f --- /dev/null +++ b/CoreLocation.framework/Headers/CLHeading.h @@ -0,0 +1,121 @@ + +/* + * CLHeading.h + * CoreLocation + * + * Copyright 2008 Apple, Inc. All rights reserved. + * + */ + +#import +#import +#import + +/* + * CLHeadingComponentValue + * + * Discussion: + * Type represents a geomagnetic value, measured in microteslas, relative to a device axis in three dimensional space. + * + */ +typedef double CLHeadingComponentValue; + +/* + * kCLHeadingFilterNone + * + * Discussion: + * Use as the headingFilter property for CLLocationManager. This indicates + * to the heading service that no minimum movement filter is desired - ie, client will be informed + * of any movement. + */ +extern const CLLocationDegrees kCLHeadingFilterNone; + +/* + * CLHeading + * + * Discussion: + * Represents a vector pointing to magnetic North constructed from axis component values x, y, and z. An accuracy of the heading calculation is also provided along with timestamp information. + */ +NS_CLASS_AVAILABLE(10_7, 3_0) +@interface CLHeading : NSObject +{ +@private + id _internal; +} + +/* + * magneticHeading + * + * Discussion: + * Represents the direction in degrees, where 0 degrees is magnetic North. The direction is referenced from the top of the device regardless of device orientation as well as the orientation of the user interface. + * + * Range: + * 0.0 - 359.9 degrees, 0 being magnetic North + */ +@property(readonly, nonatomic) CLLocationDirection magneticHeading; + +/* + * trueHeading + * + * Discussion: + * Represents the direction in degrees, where 0 degrees is true North. The direction is referenced + * from the top of the device regardless of device orientation as well as the orientation of the + * user interface. + * + * Range: + * 0.0 - 359.9 degrees, 0 being true North + */ +@property(readonly, nonatomic) CLLocationDirection trueHeading; + +/* + * headingAccuracy + * + * Discussion: + * Represents the maximum deviation of where the magnetic heading may differ from the actual geomagnetic heading in degrees. A negative value indicates an invalid heading. + */ +@property(readonly, nonatomic) CLLocationDirection headingAccuracy; + +/* + * x + * + * Discussion: + * Returns a raw value for the geomagnetism measured in the x-axis. + * + */ +@property(readonly, nonatomic) CLHeadingComponentValue x; + +/* + * y + * + * Discussion: + * Returns a raw value for the geomagnetism measured in the y-axis. + * + */ +@property(readonly, nonatomic) CLHeadingComponentValue y; + +/* + * z + * + * Discussion: + * Returns a raw value for the geomagnetism measured in the z-axis. + * + */ +@property(readonly, nonatomic) CLHeadingComponentValue z; + +/* + * timestamp + * + * Discussion: + * Returns a timestamp for when the magnetic heading was determined. + */ +@property(readonly, nonatomic) NSDate *timestamp; + +/* + * description + * + * Discussion: + * Returns a string representation of the heading. + */ +- (NSString *)description; + +@end diff --git a/CoreLocation.framework/Headers/CLLocation.h b/CoreLocation.framework/Headers/CLLocation.h new file mode 100644 index 0000000..c8107b9 --- /dev/null +++ b/CoreLocation.framework/Headers/CLLocation.h @@ -0,0 +1,277 @@ +/* + * CLLocation.h + * CoreLocation + * + * Copyright (c) 2008-2010 Apple Inc. All rights reserved. + * + */ + +#import +#import + +/* + * CLLocationDegrees + * + * Discussion: + * Type used to represent a latitude or longitude coordinate in degrees under the WGS 84 reference + * frame. The degree can be positive (North and East) or negative (South and West). + */ +typedef double CLLocationDegrees; + +/* + * CLLocationAccuracy + * + * Discussion: + * Type used to represent a location accuracy level in meters. The lower the value in meters, the + * more physically precise the location is. A negative accuracy value indicates an invalid location. + */ +typedef double CLLocationAccuracy; + +/* + * CLLocationSpeed + * + * Discussion: + * Type used to represent the speed in meters per second. + */ +typedef double CLLocationSpeed; + +/* + * CLLocationDirection + * + * Discussion: + * Type used to represent the direction in degrees from 0 to 359.9. A negative value indicates an + * invalid direction. + */ +typedef double CLLocationDirection; + +/* + * CLLocationCoordinate2D + * + * Discussion: + * A structure that contains a geographical coordinate. + * + * Fields: + * latitude: + * The latitude in degrees. + * longitude: + * The longitude in degrees. + */ +typedef struct { + CLLocationDegrees latitude; + CLLocationDegrees longitude; +} CLLocationCoordinate2D; + +/* + * CLLocationDistance + * + * Discussion: + * Type used to represent a distance in meters. + */ +typedef double CLLocationDistance; + +/* + * kCLDistanceFilterNone + * + * Discussion: + * Use as the distanceFilter property for CLLocationManager. This indicates + * to the location service that no minimum movement filter is desired - ie, client will be informed + * of any movement. + */ +extern const CLLocationDistance kCLDistanceFilterNone; + +/* + * kCLLocationAccuracy + * + * Discussion: + * Used to specify the accuracy level desired. The location service will try its best to achieve + * your desired accuracy. However, it is not guaranteed. To optimize + * power performance, be sure to specify an appropriate accuracy for your usage scenario (eg, + * use a large accuracy value when only a coarse location is needed). + */ +extern const CLLocationAccuracy kCLLocationAccuracyBestForNavigation __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); +extern const CLLocationAccuracy kCLLocationAccuracyBest; +extern const CLLocationAccuracy kCLLocationAccuracyNearestTenMeters; +extern const CLLocationAccuracy kCLLocationAccuracyHundredMeters; +extern const CLLocationAccuracy kCLLocationAccuracyKilometer; +extern const CLLocationAccuracy kCLLocationAccuracyThreeKilometers; + +/* + * CLLocationDistanceMax + * + * Discussion: + * Used to specify the maximum CLLocationDistance + */ +extern const CLLocationDistance CLLocationDistanceMax __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +/* + * CLTimeIntervalMax + * + * Discussion: + * Used to specify the maximum NSTimeInterval + */ +extern const NSTimeInterval CLTimeIntervalMax __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +/* + * kCLLocationCoordinate2DInvalid + * + * Discussion: + * Used to specify an invalid CLLocationCoordinate2D. + */ +extern const CLLocationCoordinate2D kCLLocationCoordinate2DInvalid __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * CLLocationCoordinate2DIsValid + * + * Discussion: + * Returns YES if the specified coordinate is valid, NO otherwise. + */ +BOOL CLLocationCoordinate2DIsValid(CLLocationCoordinate2D coord) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * CLLocationCoordinate2DMake: + * + * Discussion: + * Returns a new CLLocationCoordinate2D at the given latitude and longitude + */ +CLLocationCoordinate2D CLLocationCoordinate2DMake(CLLocationDegrees latitude, CLLocationDegrees longitude) __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +#ifdef __cplusplus +} +#endif + +/* + * CLLocation + * + * Discussion: + * Represents a geographical coordinate along with accuracy and timestamp information. + */ +NS_CLASS_AVAILABLE(10_6, 2_0) +@interface CLLocation : NSObject +{ +@private + id _internal; +} + +/* + * initWithLatitude:longitude: + * + * Discussion: + * Initialize with the specified latitude and longitude. + */ +- (id)initWithLatitude:(CLLocationDegrees)latitude + longitude:(CLLocationDegrees)longitude; + +/* + * initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:timestamp: + * + * Discussion: + * Initialize with the specified parameters. + */ +- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate + altitude:(CLLocationDistance)altitude + horizontalAccuracy:(CLLocationAccuracy)hAccuracy + verticalAccuracy:(CLLocationAccuracy)vAccuracy + timestamp:(NSDate *)timestamp; + +/* + * initWithCoordinate:altitude:horizontalAccuracy:verticalAccuracy:course:speed:timestamp: + * + * Discussion: + * Initialize with the specified parameters. + */ +- (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate + altitude:(CLLocationDistance)altitude + horizontalAccuracy:(CLLocationAccuracy)hAccuracy + verticalAccuracy:(CLLocationAccuracy)vAccuracy + course:(CLLocationDirection)course + speed:(CLLocationSpeed)speed + timestamp:(NSDate *)timestamp __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_2); + +/* + * coordinate + * + * Discussion: + * Returns the coordinate of the current location. + */ +@property(readonly, nonatomic) CLLocationCoordinate2D coordinate; + +/* + * altitude + * + * Discussion: + * Returns the altitude of the location. Can be positive (above sea level) or negative (below sea level). + */ +@property(readonly, nonatomic) CLLocationDistance altitude; + +/* + * horizontalAccuracy + * + * Discussion: + * Returns the horizontal accuracy of the location. Negative if the lateral location is invalid. + */ +@property(readonly, nonatomic) CLLocationAccuracy horizontalAccuracy; + +/* + * verticalAccuracy + * + * Discussion: + * Returns the vertical accuracy of the location. Negative if the altitude is invalid. + */ +@property(readonly, nonatomic) CLLocationAccuracy verticalAccuracy; + +/* + * course + * + * Discussion: + * Returns the course of the location in degrees true North. Negative if course is invalid. + * + * Range: + * 0.0 - 359.9 degrees, 0 being true North + */ +@property(readonly, nonatomic) CLLocationDirection course __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_2_2); + +/* + * speed + * + * Discussion: + * Returns the speed of the location in m/s. Negative if speed is invalid. + */ +@property(readonly, nonatomic) CLLocationSpeed speed __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_2_2); + +/* + * timestamp + * + * Discussion: + * Returns the timestamp when this location was determined. + */ +@property(readonly, nonatomic) NSDate *timestamp; + +/* + * description + * + * Discussion: + * Returns a string representation of the location. + */ +- (NSString *)description; + +/* + * getDistanceFrom: + * + * Discussion: + * Deprecated. Use -distanceFromLocation: instead. + */ +- (CLLocationDistance)getDistanceFrom:(const CLLocation *)location __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_2_0,__IPHONE_3_2); + +/* + * distanceFromLocation: + * + * Discussion: + * Returns the lateral distance between two locations. + */ +- (CLLocationDistance)distanceFromLocation:(const CLLocation *)location __OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_3_2); + +@end diff --git a/CoreLocation.framework/Headers/CLLocationManager.h b/CoreLocation.framework/Headers/CLLocationManager.h new file mode 100644 index 0000000..c8abade --- /dev/null +++ b/CoreLocation.framework/Headers/CLLocationManager.h @@ -0,0 +1,470 @@ + +/* + * CLLocationManager.h + * CoreLocation + * + * Copyright (c) 2008-2010 Apple Inc. All rights reserved. + * + */ + +#import +#import +#import +#import + +/* + * CLDeviceOrientation + * + * Discussion: + * Specifies a physical device orientation, equivalent to UIDeviceOrientation. + * + */ +typedef enum { + CLDeviceOrientationUnknown = 0, + CLDeviceOrientationPortrait, + CLDeviceOrientationPortraitUpsideDown, + CLDeviceOrientationLandscapeLeft, + CLDeviceOrientationLandscapeRight, + CLDeviceOrientationFaceUp, + CLDeviceOrientationFaceDown +} CLDeviceOrientation; + +/* + * CLAuthorizationStatus + * + * Discussion: + * Represents the current authorization state of the application. + * + */ +typedef enum { + kCLAuthorizationStatusNotDetermined = 0, // User has not yet made a choice with regards to this application + kCLAuthorizationStatusRestricted, // This application is not authorized to use location services. Due + // to active restrictions on location services, the user cannot change + // this status, and may not have personally denied authorization + kCLAuthorizationStatusDenied, // User has explicitly denied authorization for this application, or + // location services are disabled in Settings + kCLAuthorizationStatusAuthorized // User has authorized this application to use location services +} CLAuthorizationStatus; + +/* + * CLActivityType + * + * Discussion: + * Enumerates the different possible activity types. This currently + * affects behavior such as the determination of when location updates + * may be automatically paused. + */ +enum { + CLActivityTypeOther = 1, + CLActivityTypeAutomotiveNavigation, // for automotive navigation + CLActivityTypeFitness, // includes any pedestrian activities + CLActivityTypeOtherNavigation // for other navigation cases (excluding pedestrian navigation), e.g. navigation for boats, trains, or planes +}; +typedef NSInteger CLActivityType; + +@class CLLocation; +@class CLHeading; +@class CLBeaconRegion; +@protocol CLLocationManagerDelegate; + +/* + * CLLocationManager + * + * Discussion: + * The CLLocationManager object is your entry point to the location service. + */ +NS_CLASS_AVAILABLE(10_6, 2_0) +@interface CLLocationManager : NSObject +{ +@private + id _internal; +} + +/* + * locationServicesEnabled + * + * Discussion: + * Determines whether the user has location services enabled. + * If NO, and you proceed to call other CoreLocation API, user will be prompted with the warning + * dialog. You may want to check this property and use location services only when explicitly requested by the user. + */ ++ (BOOL)locationServicesEnabled __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * headingAvailable + * + * Discussion: + * Returns YES if the device supports the heading service, otherwise NO. + */ ++ (BOOL)headingAvailable __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * significantLocationChangeMonitoringAvailable + * + * Discussion: + * Returns YES if the device supports significant location change monitoring, otherwise NO. + */ ++ (BOOL)significantLocationChangeMonitoringAvailable __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * isMonitoringAvailableForClass: + * + * Discussion: + * Determines whether the device supports monitoring for the specified type of region. + * If NO, all attempts to monitor the specified type of region will fail. + */ ++ (BOOL)isMonitoringAvailableForClass:(Class)regionClass __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * regionMonitoringAvailable + * + * Discussion: + * Deprecated. Use +isMonitoringAvailableForClass: instead. + */ ++ (BOOL)regionMonitoringAvailable __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7,__MAC_NA,__IPHONE_4_0,__IPHONE_7_0); + +/* + * regionMonitoringEnabled + * + * Discussion: + * Deprecated. Use +isMonitoringAvailableForClass: and +authorizationStatus instead. + */ ++ (BOOL)regionMonitoringEnabled __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA,__IPHONE_4_0, __IPHONE_6_0); + +/* + * isRangingAvailable + * + * Discussion: + * Determines whether the device supports ranging. + * If NO, all attempts to range beacons will fail. + */ ++ (BOOL)isRangingAvailable __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * authorizationStatus + * + * Discussion: + * Returns the current authorization status of the calling application. + */ ++ (CLAuthorizationStatus)authorizationStatus __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_2); + +@property(assign, nonatomic) id delegate; + +/* + * locationServicesEnabled + * + * Discussion: + * Deprecated. Use +locationServicesEnabled instead. + */ +@property(readonly, nonatomic) BOOL locationServicesEnabled __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_2_0,__IPHONE_4_0); + +/* + * purpose + * + * Discussion: + * Allows the application to specify what location will be used for in their app. This + * will be displayed along with the standard Location permissions dialogs. This property will need to be + * set prior to calling startUpdatingLocation. + * + * Deprecated. Set the purpose string in Info.plist using key NSLocationUsageDescription. + */ +@property(copy, nonatomic) NSString *purpose __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7, __MAC_NA, __IPHONE_3_2, __IPHONE_6_0); + +/* + * activityType + * + * Discussion: + * Specifies the type of user activity. Currently affects behavior such as + * the determination of when location updates may be automatically paused. + * By default, CLActivityTypeOther is used. + */ +@property(assign, nonatomic) CLActivityType activityType __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +/* + * distanceFilter + * + * Discussion: + * Specifies the minimum update distance in meters. Client will not be notified of movements of less + * than the stated value, unless the accuracy has improved. Pass in kCLDistanceFilterNone to be + * notified of all movements. By default, kCLDistanceFilterNone is used. + */ +@property(assign, nonatomic) CLLocationDistance distanceFilter; + +/* + * desiredAccuracy + * + * Discussion: + * The desired location accuracy. The location service will try its best to achieve + * your desired accuracy. However, it is not guaranteed. To optimize + * power performance, be sure to specify an appropriate accuracy for your usage scenario (eg, + * use a large accuracy value when only a coarse location is needed). Use kCLLocationAccuracyBest to + * achieve the best possible accuracy. Use kCLLocationAccuracyBestForNavigation for navigation. + * By default, kCLLocationAccuracyBest is used. + */ +@property(assign, nonatomic) CLLocationAccuracy desiredAccuracy; + +/* + * pausesLocationUpdatesAutomatically + * + * Discussion: + * Specifies that location updates may automatically be paused when possible. + * By default, this is YES for applications linked against iOS 6.0 or later. + */ +@property(assign, nonatomic) BOOL pausesLocationUpdatesAutomatically __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +/* + * location + * + * Discussion: + * The last location received. Will be nil until a location has been received. + */ +@property(readonly, nonatomic) CLLocation *location; + +/* + * headingAvailable + * + * Discussion: + * Deprecated. Use +headingAvailable instead. + */ +@property(readonly, nonatomic) BOOL headingAvailable __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA,__MAC_NA,__IPHONE_3_0,__IPHONE_4_0); + +/* + * headingFilter + * + * Discussion: + * Specifies the minimum amount of change in degrees needed for a heading service update. Client will not + * be notified of updates less than the stated filter value. Pass in kCLHeadingFilterNone to be + * notified of all updates. By default, 1 degree is used. + */ +@property(assign, nonatomic) CLLocationDegrees headingFilter __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); + +/* + * headingOrientation + * + * Discussion: + * Specifies a physical device orientation from which heading calculation should be referenced. By default, + * CLDeviceOrientationPortrait is used. CLDeviceOrientationUnknown, CLDeviceOrientationFaceUp, and + * CLDeviceOrientationFaceDown are ignored. + * + */ +@property(assign, nonatomic) CLDeviceOrientation headingOrientation __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0); + +/* + * heading + * + * Discussion: + * Returns the latest heading update received, or nil if none is available. + */ +@property(readonly, nonatomic) CLHeading *heading __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0); + +/* + * maximumRegionMonitoringDistance + * + * Discussion: + * the maximum region size, in terms of a distance from a central point, that the framework can support. + * Attempts to register a region larger than this will generate a kCLErrorRegionMonitoringFailure. + * This value may vary based on the hardware features of the device, as well as on dynamically changing resource constraints. + */ +@property (readonly, nonatomic) CLLocationDistance maximumRegionMonitoringDistance __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * monitoredRegions + * + * Discussion: + * Retrieve a set of objects for the regions that are currently being monitored. If any location manager + * has been instructed to monitor a region, during this or previous launches of your application, it will + * be present in this set. + */ +@property (readonly, nonatomic) NSSet *monitoredRegions __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * rangedRegions + * + * Discussion: + * Retrieve a set of objects representing the regions for which this location manager is actively providing ranging. + */ +@property (readonly, nonatomic) NSSet *rangedRegions __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * startUpdatingLocation + * + * Discussion: + * Start updating locations. + */ +- (void)startUpdatingLocation; + +/* + * stopUpdatingLocation + * + * Discussion: + * Stop updating locations. + */ +- (void)stopUpdatingLocation; + +/* + * startUpdatingHeading + * + * Discussion: + * Start updating heading. + */ +- (void)startUpdatingHeading __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); + +/* + * stopUpdatingHeading + * + * Discussion: + * Stop updating heading. + */ +- (void)stopUpdatingHeading __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); + +/* + * dismissHeadingCalibrationDisplay + * + * Discussion: + * Dismiss the heading calibration immediately. + */ +- (void)dismissHeadingCalibrationDisplay __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); + +/* + * startMonitoringSignificantLocationChanges + * + * Discussion: + * Start monitoring significant location changes. The behavior of this service is not affected by the desiredAccuracy + * or distanceFilter properties. Locations will be delivered through the same delegate callback as the standard + * location service. + * + */ +- (void)startMonitoringSignificantLocationChanges __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * stopMonitoringSignificantLocationChanges + * + * Discussion: + * Stop monitoring significant location changes. + * + */ +- (void)stopMonitoringSignificantLocationChanges __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * startMonitoringForRegion:desiredAccuracy: + * + * Discussion: + * Start monitoring the specified region. desiredAccuracy represents the distance past the border of the region at + * which the application would like to be notified that the region border has been crossed. This is useful to prevent + * repeated notifications when the user is on the border of the region. This value will be honored on a best-effort basis, + * and may not be respected if desiredAccuracy is large with respect to the size of the region, or if the device is not + * capable of providing the precision desired. + * + * If a region of the same type with the same identifier is already being monitored for this application, it will be + * removed from monitoring. + * + * This is done asynchronously and may not be immediately reflected in monitoredRegions. + */ +- (void)startMonitoringForRegion:(CLRegion *)region + desiredAccuracy:(CLLocationAccuracy)accuracy __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA,__IPHONE_4_0, __IPHONE_6_0); + +/* + * stopMonitoringForRegion: + * + * Discussion: + * Stop monitoring the specified region. It is valid to call stopMonitoringForRegion: for a region that was registered + * for monitoring with a different location manager object, during this or previous launches of your application. + * + * This is done asynchronously and may not be immediately reflected in monitoredRegions. + */ +- (void)stopMonitoringForRegion:(CLRegion *)region __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * startMonitoringForRegion: + * + * Discussion: + * Start monitoring the specified region. + * + * If a region of the same type with the same identifier is already being monitored for this application, + * it will be removed from monitoring. For circular regions, the region monitoring service will prioritize + * regions by their size, favoring smaller regions over larger regions. + * + * This is done asynchronously and may not be immediately reflected in monitoredRegions. + */ +- (void)startMonitoringForRegion:(CLRegion *)region __OSX_AVAILABLE_STARTING(__MAC_TBD,__IPHONE_5_0); + +/* + * requestStateForRegion: + * + * Discussion: + * Asynchronously retrieve the cached state of the specified region. The state is returned to the delegate via + * locationManager:didDetermineState:forRegion:. + */ +- (void)requestStateForRegion:(CLRegion *)region __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * startRangingBeaconsInRegion: + * + * Discussion: + * Start calculating ranges for beacons in the specified region. + */ +- (void)startRangingBeaconsInRegion:(CLBeaconRegion *)region __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * stopRangingBeaconsInRegion: + * + * Discussion: + * Stop calculating ranges for the specified region. + */ +- (void)stopRangingBeaconsInRegion:(CLBeaconRegion *)region __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * allowDeferredLocationUpdatesUntilTraveled:timeout: + * + * Discussion: + * Indicate that the application will allow the location manager to defer + * location updates until an exit criterion is met. This may allow the + * device to enter a low-power state in which updates are held for later + * delivery. Once an exit condition is met, the location manager will + * continue normal updates until this method is invoked again. + * + * Exit conditions, distance and timeout, can be specified using the constants + * CLLocationDistanceMax and CLTimeIntervalMax, respectively, if you are + * trying to achieve an unlimited distance or timeout. + * + * The CLLocationManagerDelegate will continue to receive normal updates as + * long as the application remains in the foreground. While the process is + * in the background, the device may be able to enter a low-power state for + * portions of the specified distance and time interval. While in this + * state, locations will be coalesced for later delivery. + * + * Location updates will be deferred as much as is reasonable to save + * power. If another process is using location, the device may not enter a + * low-power state and instead updates will continue normally. Deferred + * updates may be interspersed with normal updates if the device exits and + * re-enters a low-power state. + * + * All location updates, including deferred updates, will be delivered via + * the delegate callback locationManager:didUpdateLocations: + * + * When deferred updates have ended, the manager will invoke the delegate + * callback locationManagerDidFinishDeferredUpdates:withError:. An error + * will be returned if the manager will not defer updates and the exit + * criteria have not been met. + */ +- (void)allowDeferredLocationUpdatesUntilTraveled:(CLLocationDistance)distance + timeout:(NSTimeInterval)timeout __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +/* + * disallowDeferredLocationUpdates + * + * Discussion: + * Disallow deferred location updates if previously enabled. Any outstanding + * updates will be sent and regular location updates will resume. + */ +- (void)disallowDeferredLocationUpdates __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +/* + * deferredLocationUpdatesAvailable + * + * Discussion: + * Returns YES if the device supports deferred location updates, otherwise NO. + */ ++ (BOOL)deferredLocationUpdatesAvailable __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +@end diff --git a/CoreLocation.framework/Headers/CLLocationManagerDelegate.h b/CoreLocation.framework/Headers/CLLocationManagerDelegate.h new file mode 100644 index 0000000..b1ad2df --- /dev/null +++ b/CoreLocation.framework/Headers/CLLocationManagerDelegate.h @@ -0,0 +1,191 @@ + +/* + * CLLocationManagerDelegate.h + * CoreLocation + * + * Copyright (c) 2008-2010 Apple Inc. All rights reserved. + * + */ + +#import +#import +#import +#import + +@class CLLocation; +@class CLHeading; + +/* + * CLLocationManagerDelegate + * + * Discussion: + * Delegate for CLLocationManager. + */ +@protocol CLLocationManagerDelegate + +@optional + +/* + * locationManager:didUpdateToLocation:fromLocation: + * + * Discussion: + * Invoked when a new location is available. oldLocation may be nil if there is no previous location + * available. + * + * This method is deprecated. If locationManager:didUpdateLocations: is + * implemented, this method will not be called. + */ +- (void)locationManager:(CLLocationManager *)manager + didUpdateToLocation:(CLLocation *)newLocation + fromLocation:(CLLocation *)oldLocation __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_6, __MAC_NA, __IPHONE_2_0, __IPHONE_6_0); + +/* + * locationManager:didUpdateLocations: + * + * Discussion: + * Invoked when new locations are available. Required for delivery of + * deferred locations. If implemented, updates will + * not be delivered to locationManager:didUpdateToLocation:fromLocation: + * + * locations is an array of CLLocation objects in chronological order. + */ +- (void)locationManager:(CLLocationManager *)manager + didUpdateLocations:(NSArray *)locations __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +/* + * locationManager:didUpdateHeading: + * + * Discussion: + * Invoked when a new heading is available. + */ +- (void)locationManager:(CLLocationManager *)manager + didUpdateHeading:(CLHeading *)newHeading __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); + +/* + * locationManagerShouldDisplayHeadingCalibration: + * + * Discussion: + * Invoked when a new heading is available. Return YES to display heading calibration info. The display + * will remain until heading is calibrated, unless dismissed early via dismissHeadingCalibrationDisplay. + */ +- (BOOL)locationManagerShouldDisplayHeadingCalibration:(CLLocationManager *)manager __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_0); + +/* + * locationManager:didDetermineState:forRegion: + * + * Discussion: + * Invoked when there's a state transition for a monitored region or in response to a request for state via a + * a call to requestStateForRegion:. + */ +- (void)locationManager:(CLLocationManager *)manager + didDetermineState:(CLRegionState)state forRegion:(CLRegion *)region __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * locationManager:didRangeBeacons:inRegion: + * + * Discussion: + * Invoked when a new set of beacons are available in the specified region. + * beacons is an array of CLBeacon objects. + * If beacons is empty, it may be assumed no beacons that match the specified region are nearby. + * Similarly if a specific beacon no longer appears in beacons, it may be assumed the beacon is no longer received + * by the device. + */ +- (void)locationManager:(CLLocationManager *)manager + didRangeBeacons:(NSArray *)beacons inRegion:(CLBeaconRegion *)region __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * locationManager:rangingBeaconsDidFailForRegion:withError: + * + * Discussion: + * Invoked when an error has occurred ranging beacons in a region. Error types are defined in "CLError.h". + */ +- (void)locationManager:(CLLocationManager *)manager + rangingBeaconsDidFailForRegion:(CLBeaconRegion *)region + withError:(NSError *)error __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * locationManager:didEnterRegion: + * + * Discussion: + * Invoked when the user enters a monitored region. This callback will be invoked for every allocated + * CLLocationManager instance with a non-nil delegate that implements this method. + */ +- (void)locationManager:(CLLocationManager *)manager + didEnterRegion:(CLRegion *)region __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * locationManager:didExitRegion: + * + * Discussion: + * Invoked when the user exits a monitored region. This callback will be invoked for every allocated + * CLLocationManager instance with a non-nil delegate that implements this method. + */ +- (void)locationManager:(CLLocationManager *)manager + didExitRegion:(CLRegion *)region __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * locationManager:didFailWithError: + * + * Discussion: + * Invoked when an error has occurred. Error types are defined in "CLError.h". + */ +- (void)locationManager:(CLLocationManager *)manager + didFailWithError:(NSError *)error; + +/* + * locationManager:monitoringDidFailForRegion:withError: + * + * Discussion: + * Invoked when a region monitoring error has occurred. Error types are defined in "CLError.h". + */ +- (void)locationManager:(CLLocationManager *)manager + monitoringDidFailForRegion:(CLRegion *)region + withError:(NSError *)error __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * locationManager:didChangeAuthorizationStatus: + * + * Discussion: + * Invoked when the authorization status changes for this application. + */ +- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_2); + +/* + * locationManager:didStartMonitoringForRegion: + * + * Discussion: + * Invoked when a monitoring for a region started successfully. + */ +- (void)locationManager:(CLLocationManager *)manager + didStartMonitoringForRegion:(CLRegion *)region __OSX_AVAILABLE_STARTING(__MAC_TBD,__IPHONE_5_0); + +/* + * Discussion: + * Invoked when location updates are automatically paused. + */ +- (void)locationManagerDidPauseLocationUpdates:(CLLocationManager *)manager __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +/* + * Discussion: + * Invoked when location updates are automatically resumed. + * + * In the event that your application is terminated while suspended, you will + * not receive this notification. + */ +- (void)locationManagerDidResumeLocationUpdates:(CLLocationManager *)manager __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +/* + * locationManager:didFinishDeferredUpdatesWithError: + * + * Discussion: + * Invoked when deferred updates will no longer be delivered. Stopping + * location, disallowing deferred updates, and meeting a specified criterion + * are all possible reasons for finishing deferred updates. + * + * An error will be returned if deferred updates end before the specified + * criteria are met (see CLError). + */ +- (void)locationManager:(CLLocationManager *)manager + didFinishDeferredUpdatesWithError:(NSError *)error __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_6_0); + +@end diff --git a/CoreLocation.framework/Headers/CLPlacemark.h b/CoreLocation.framework/Headers/CLPlacemark.h new file mode 100644 index 0000000..9ce3dc6 --- /dev/null +++ b/CoreLocation.framework/Headers/CLPlacemark.h @@ -0,0 +1,81 @@ +/* + * CLPlacemark.h + * CoreLocation + * + * Copyright (c) 2010 Apple Inc. All rights reserved. + */ + +#if TARGET_OS_IPHONE + +#import +#import + +@class CLLocation; +@class CLRegion; +@class CLPlacemarkInternal; + +/* + * CLPlacemark + * + * Discussion: + * Represents placemark data for a geographic location. Placemark data can be + * information such as the country, state, city, and street address. + */ + +NS_CLASS_AVAILABLE(TBD,5_0) +@interface CLPlacemark : NSObject +{ +@private + CLPlacemarkInternal *_internal; +} + +/* + * initWithPlacemark: + * + * Discussion: + * Initialize a newly allocated placemark from another placemark, copying its data. + */ +- (id)initWithPlacemark:(CLPlacemark *)placemark; + +/* + * location + * + * Discussion: + * Returns the geographic location associated with the placemark. + */ +@property (nonatomic, readonly) CLLocation *location; + +/* + * region + * + * Discussion: + * Returns the geographic region associated with the placemark. + */ +@property (nonatomic, readonly) CLRegion *region; + +/* + * addressDictionary + * + * Discussion: + * This dictionary can be formatted as an address using ABCreateStringWithAddressDictionary, + * defined in the AddressBookUI framework. + */ +@property (nonatomic, readonly) NSDictionary *addressDictionary; + +// address dictionary properties +@property (nonatomic, readonly) NSString *name; // eg. Apple Inc. +@property (nonatomic, readonly) NSString *thoroughfare; // street address, eg. 1 Infinite Loop +@property (nonatomic, readonly) NSString *subThoroughfare; // eg. 1 +@property (nonatomic, readonly) NSString *locality; // city, eg. Cupertino +@property (nonatomic, readonly) NSString *subLocality; // neighborhood, common name, eg. Mission District +@property (nonatomic, readonly) NSString *administrativeArea; // state, eg. CA +@property (nonatomic, readonly) NSString *subAdministrativeArea; // county, eg. Santa Clara +@property (nonatomic, readonly) NSString *postalCode; // zip code, eg. 95014 +@property (nonatomic, readonly) NSString *ISOcountryCode; // eg. US +@property (nonatomic, readonly) NSString *country; // eg. United States +@property (nonatomic, readonly) NSString *inlandWater; // eg. Lake Tahoe +@property (nonatomic, readonly) NSString *ocean; // eg. Pacific Ocean +@property (nonatomic, readonly) NSArray *areasOfInterest; // eg. Golden Gate Park +@end + +#endif //TARGET_OS_IPHONE diff --git a/CoreLocation.framework/Headers/CLRegion.h b/CoreLocation.framework/Headers/CLRegion.h new file mode 100644 index 0000000..cc97f18 --- /dev/null +++ b/CoreLocation.framework/Headers/CLRegion.h @@ -0,0 +1,119 @@ +/* + * CLRegion.h + * CoreLocation + * + * Copyright (c) 2009-2010 Apple Inc. All rights reserved. + * + */ + +#import +#import +#import + +/* + * CLRegionState + * + * Discussion: + * Represents the current state of the device with reference to a region. + * + */ +typedef NS_ENUM(NSInteger, CLRegionState) { + CLRegionStateUnknown, + CLRegionStateInside, + CLRegionStateOutside +} NS_ENUM_AVAILABLE_IOS(7_0); + +/* + * CLProximity + * + * Discussion: + * Represents the current proximity of an entity. + * + */ +typedef NS_ENUM(NSInteger, CLProximity) { + CLProximityUnknown, + CLProximityImmediate, + CLProximityNear, + CLProximityFar +} NS_ENUM_AVAILABLE_IOS(7_0); + +/* + * CLRegion + * + * Discussion: + * A logical area. + */ +NS_CLASS_AVAILABLE(10_7, 4_0) +@interface CLRegion : NSObject + +/* + * initCircularRegionWithCenter:radius:identifier: + * + * Discussion: + * Initialize a region. center gives the coordinates of center of the region, while radius gives + * the distance in meters between the center and the region's boundary. identifier is a description + * for the region that could be displayed to the user, and ideally should be chosen by the user. + * + * This method has been deprecated, please see CLCircularRegion. + */ +- (id)initCircularRegionWithCenter:(CLLocationCoordinate2D)center + radius:(CLLocationDistance)radius + identifier:(NSString *)identifier __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7,__MAC_NA,__IPHONE_4_0,__IPHONE_7_0); + +/* + * center + * + * Discussion: + * Returns the coordinate of the center of the region. + * + * This method has been deprecated, please see CLCircularRegion. + */ +@property (readonly, nonatomic) CLLocationCoordinate2D center __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7,__MAC_NA,__IPHONE_4_0,__IPHONE_7_0); + +/* + * radius + * + * Discussion: + * Returns the radius of the region. + * + * This method has been deprecated, please see CLCircularRegion. + */ +@property (readonly, nonatomic) CLLocationDistance radius __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7,__MAC_NA,__IPHONE_4_0,__IPHONE_7_0); + +/* + * identifier + * + * Discussion: + * Returns the region's identifier. + */ +@property (readonly, nonatomic) NSString *identifier __OSX_AVAILABLE_STARTING(__MAC_10_7,__IPHONE_4_0); + +/* + * notifyOnEntry + * + * Discussion: + * App will be launched and the delegate will be notified via locationManager:didEnterRegion: + * when the user enters the region. By default, this is YES. + */ +@property (nonatomic, assign) BOOL notifyOnEntry __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * notifyOnExit + * + * Discussion: + * App will be launched and the delegate will be notified via locationManager:didExitRegion: + * when the user exits the region. By default, this is YES. + */ +@property (nonatomic, assign) BOOL notifyOnExit __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_7_0); + +/* + * containsCoordinate: + * + * Discussion: + * Returns YES if the coordinate lies inside the region, and NO otherwise. + * + * This method has been deprecated, please see CLCircularRegion. + */ +- (BOOL)containsCoordinate:(CLLocationCoordinate2D)coordinate __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_7,__MAC_NA,__IPHONE_4_0,__IPHONE_7_0); + +@end diff --git a/CoreLocation.framework/Headers/CoreLocation.h b/CoreLocation.framework/Headers/CoreLocation.h new file mode 100644 index 0000000..abcae6a --- /dev/null +++ b/CoreLocation.framework/Headers/CoreLocation.h @@ -0,0 +1,30 @@ +/* + * CoreLocation.h + * CoreLocation + * + * Copyright (c) 2008-2010 Apple Inc. All rights reserved. + * + */ + + +#ifndef __CORELOCATION__ +#define __CORELOCATION__ + +#ifndef __CL_INDIRECT__ +#define __CL_INDIRECT__ +#endif + +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import +#import + +#endif /* __CORELOCATION__ */ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..6ae867d --- /dev/null +++ b/LICENSE @@ -0,0 +1 @@ +TODO: place your license here and we'll include it in the module distribution diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..4124b1d --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1 @@ +Place your license text here. This file will be incorporated with your app at package time. \ No newline at end of file diff --git a/OrgBeuckmanTibeacons_Prefix.pch b/OrgBeuckmanTibeacons_Prefix.pch new file mode 100644 index 0000000..8bec24f --- /dev/null +++ b/OrgBeuckmanTibeacons_Prefix.pch @@ -0,0 +1,4 @@ + +#ifdef __OBJC__ + #import +#endif diff --git a/README b/README new file mode 100644 index 0000000..5e716e9 --- /dev/null +++ b/README @@ -0,0 +1,151 @@ +Appcelerator Titanium iPhone Module Project +=========================================== + +This is a skeleton Titanium Mobile iPhone module project. Modules can be +used to extend the functionality of Titanium by providing additional native +code that is compiled into your application at build time and can expose certain +APIs into JavaScript. + +MODULE NAMING +-------------- + +Choose a unique module id for your module. This ID usually follows a namespace +convention using DNS notation. For example, com.appcelerator.module.test. This +ID can only be used once by all public modules in Titanium. + + +COMPONENTS +----------- + +Components that are exposed by your module must follow a special naming convention. +A component (widget, proxy, etc) must be named with the pattern: + + TiProxy + +For example, if you component was called Foo, your proxy would be named: + + TiMyfirstFooProxy + +For view proxies or widgets, you must create both a view proxy and a view implementation. +If you widget was named proxy, you would create the following files: + + TiMyfirstFooProxy.h + TiMyfirstFooProxy.m + TiMyfirstFoo.h + TiMyfirstFoo.m + +The view implementation is named the same except it does contain the suffix `Proxy`. + +View implementations extend the Titanium base class `TiUIView`. View Proxies extend the +Titanium base class `TiUIViewProxy` or `TiUIWidgetProxy`. + +For proxies that are simply native objects that can be returned to JavaScript, you can +simply extend `TiProxy` and no view implementation is required. + + +GET STARTED +------------ + +1. Edit manifest with the appropriate details about your module. +2. Edit LICENSE to add your license details. +3. Place any assets (such as PNG files) that are required in the assets folder. +4. Edit the titanium.xcconfig and make sure you're building for the right Titanium version. +5. Code and build. + +BUILD TIME COMPILER CONFIG +-------------------------- + +You can edit the file `module.xcconfig` to include any build time settings that should be +set during application compilation that your module requires. This file will automatically get `#include` in the main application project. + +For more information about this file, please see the Apple documentation at: + + + + +DOCUMENTATION FOR YOUR MODULE +----------------------------- + +You should provide at least minimal documentation for your module in `documentation` folder using the Markdown syntax. + +For more information on the Markdown syntax, refer to this documentation at: + + + + +TEST HARNESS EXAMPLE FOR YOUR MODULE +------------------------------------ + +The `example` directory contains a skeleton application test harness that can be +used for testing and providing an example of usage to the users of your module. + + +INSTALL YOUR MODULE +-------------------- + +1. Run `build.py` which creates your distribution +2. cd to `/Library/Application Support/Titanium` +3. copy this zip file into the folder of your Titanium SDK + +REGISTER YOUR MODULE +--------------------- + +Register your module with your application by editing `tiapp.xml` and adding your module. +Example: + + + org.beuckman.tibeacons + + +When you run your project, the compiler will know automatically compile in your module +dependencies and copy appropriate image assets into the application. + +USING YOUR MODULE IN CODE +------------------------- + +To use your module in code, you will need to require it. + +For example, + + var my_module = require('org.beuckman.tibeacons'); + my_module.foo(); + +WRITING PURE JS NATIVE MODULES +------------------------------ + +You can write a pure JavaScript "natively compiled" module. This is nice if you +want to distribute a JS module pre-compiled. + +To create a module, create a file named org.beuckman.tibeacons.js under the assets folder. +This file must be in the Common JS format. For example: + + exports.echo = function(s) + { + return s; + }; + +Any functions and properties that are exported will be made available as part of your +module. All other code inside your JS will be private to your module. + +For pure JS module, you don't need to modify any of the Objective-C module code. You +can leave it as-is and build. + +TESTING YOUR MODULE +------------------- + +Run the `titanium.py` script to test your module or test from within XCode. +To test with the script, execute: + + titanium run --dir=YOURMODULEDIR + + +This will execute the app.js in the example folder as a Titanium application. + + +DISTRIBUTING YOUR MODULE +------------------------- + +Currently, you will need to manually distribution your module distribution zip file directly. However, in the near future, we will make module distribution and sharing built-in to Titanium Developer and in the Titanium Marketplace! + + +Cheers! diff --git a/TiBeacons.xcodeproj/project.pbxproj b/TiBeacons.xcodeproj/project.pbxproj new file mode 100644 index 0000000..56b3bd7 --- /dev/null +++ b/TiBeacons.xcodeproj/project.pbxproj @@ -0,0 +1,428 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXAggregateTarget section */ + 24416B8111C4CA220047AFDD /* Build & Test */ = { + isa = PBXAggregateTarget; + buildConfigurationList = 24416B8A11C4CA520047AFDD /* Build configuration list for PBXAggregateTarget "Build & Test" */; + buildPhases = ( + 24416B8011C4CA220047AFDD /* ShellScript */, + ); + dependencies = ( + 24416B8511C4CA280047AFDD /* PBXTargetDependency */, + ); + name = "Build & Test"; + productName = "Build & test"; + }; +/* End PBXAggregateTarget section */ + +/* Begin PBXBuildFile section */ + 24DD6CF91134B3F500162E58 /* OrgBeuckmanTibeaconsModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 24DD6CF71134B3F500162E58 /* OrgBeuckmanTibeaconsModule.h */; }; + 24DD6CFA1134B3F500162E58 /* OrgBeuckmanTibeaconsModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DD6CF81134B3F500162E58 /* OrgBeuckmanTibeaconsModule.m */; }; + 24DE9E1111C5FE74003F90F6 /* OrgBeuckmanTibeaconsModuleAssets.h in Headers */ = {isa = PBXBuildFile; fileRef = 24DE9E0F11C5FE74003F90F6 /* OrgBeuckmanTibeaconsModuleAssets.h */; }; + 24DE9E1211C5FE74003F90F6 /* OrgBeuckmanTibeaconsModuleAssets.m in Sources */ = {isa = PBXBuildFile; fileRef = 24DE9E1011C5FE74003F90F6 /* OrgBeuckmanTibeaconsModuleAssets.m */; }; + AA747D9F0F9514B9006C5449 /* OrgBeuckmanTibeacons_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* OrgBeuckmanTibeacons_Prefix.pch */; }; + AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; }; + D87CB613181B3E2F00D08EBC /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D87CB60D181B3E2F00D08EBC /* CoreLocation.framework */; }; + D87CB614181B3E2F00D08EBC /* CoreBluetooth.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D87CB60E181B3E2F00D08EBC /* CoreBluetooth.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 24416B8411C4CA280047AFDD /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 0867D690FE84028FC02AAC07 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D2AAC07D0554694100DB518D; + remoteInfo = TiBeacons; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 24DD6CF71134B3F500162E58 /* OrgBeuckmanTibeaconsModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OrgBeuckmanTibeaconsModule.h; path = Classes/OrgBeuckmanTibeaconsModule.h; sourceTree = ""; }; + 24DD6CF81134B3F500162E58 /* OrgBeuckmanTibeaconsModule.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OrgBeuckmanTibeaconsModule.m; path = Classes/OrgBeuckmanTibeaconsModule.m; sourceTree = ""; }; + 24DD6D1B1134B66800162E58 /* titanium.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = titanium.xcconfig; sourceTree = ""; }; + 24DE9E0F11C5FE74003F90F6 /* OrgBeuckmanTibeaconsModuleAssets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OrgBeuckmanTibeaconsModuleAssets.h; path = Classes/OrgBeuckmanTibeaconsModuleAssets.h; sourceTree = ""; }; + 24DE9E1011C5FE74003F90F6 /* OrgBeuckmanTibeaconsModuleAssets.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = OrgBeuckmanTibeaconsModuleAssets.m; path = Classes/OrgBeuckmanTibeaconsModuleAssets.m; sourceTree = ""; }; + AA747D9E0F9514B9006C5449 /* OrgBeuckmanTibeacons_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OrgBeuckmanTibeacons_Prefix.pch; sourceTree = SOURCE_ROOT; }; + AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + D2AAC07E0554694100DB518D /* libOrgBeuckmanTibeacons.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libOrgBeuckmanTibeacons.a; sourceTree = BUILT_PRODUCTS_DIR; }; + D87CB60D181B3E2F00D08EBC /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CoreLocation.framework; sourceTree = ""; }; + D87CB60E181B3E2F00D08EBC /* CoreBluetooth.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CoreBluetooth.framework; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D2AAC07C0554694100DB518D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D87CB613181B3E2F00D08EBC /* CoreLocation.framework in Frameworks */, + D87CB614181B3E2F00D08EBC /* CoreBluetooth.framework in Frameworks */, + AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 034768DFFF38A50411DB9C8B /* Products */ = { + isa = PBXGroup; + children = ( + D2AAC07E0554694100DB518D /* libOrgBeuckmanTibeacons.a */, + ); + name = Products; + sourceTree = ""; + }; + 0867D691FE84028FC02AAC07 /* TiBeacons */ = { + isa = PBXGroup; + children = ( + 08FB77AEFE84172EC02AAC07 /* Classes */, + 32C88DFF0371C24200C91783 /* Other Sources */, + 0867D69AFE84028FC02AAC07 /* Frameworks */, + 034768DFFF38A50411DB9C8B /* Products */, + ); + name = TiBeacons; + sourceTree = ""; + }; + 0867D69AFE84028FC02AAC07 /* Frameworks */ = { + isa = PBXGroup; + children = ( + D87CB60D181B3E2F00D08EBC /* CoreLocation.framework */, + D87CB60E181B3E2F00D08EBC /* CoreBluetooth.framework */, + AACBBE490F95108600F1A2B1 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 08FB77AEFE84172EC02AAC07 /* Classes */ = { + isa = PBXGroup; + children = ( + 24DE9E0F11C5FE74003F90F6 /* OrgBeuckmanTibeaconsModuleAssets.h */, + 24DE9E1011C5FE74003F90F6 /* OrgBeuckmanTibeaconsModuleAssets.m */, + 24DD6CF71134B3F500162E58 /* OrgBeuckmanTibeaconsModule.h */, + 24DD6CF81134B3F500162E58 /* OrgBeuckmanTibeaconsModule.m */, + ); + name = Classes; + sourceTree = ""; + }; + 32C88DFF0371C24200C91783 /* Other Sources */ = { + isa = PBXGroup; + children = ( + AA747D9E0F9514B9006C5449 /* OrgBeuckmanTibeacons_Prefix.pch */, + 24DD6D1B1134B66800162E58 /* titanium.xcconfig */, + ); + name = "Other Sources"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + D2AAC07A0554694100DB518D /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + AA747D9F0F9514B9006C5449 /* OrgBeuckmanTibeacons_Prefix.pch in Headers */, + 24DD6CF91134B3F500162E58 /* OrgBeuckmanTibeaconsModule.h in Headers */, + 24DE9E1111C5FE74003F90F6 /* OrgBeuckmanTibeaconsModuleAssets.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + D2AAC07D0554694100DB518D /* TiBeacons */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "TiBeacons" */; + buildPhases = ( + D2AAC07A0554694100DB518D /* Headers */, + D2AAC07B0554694100DB518D /* Sources */, + D2AAC07C0554694100DB518D /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TiBeacons; + productName = TiBeacons; + productReference = D2AAC07E0554694100DB518D /* libOrgBeuckmanTibeacons.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 0867D690FE84028FC02AAC07 /* Project object */ = { + isa = PBXProject; + attributes = { + }; + buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "TiBeacons" */; + compatibilityVersion = "Xcode 3.1"; + developmentRegion = English; + hasScannedForEncodings = 1; + knownRegions = ( + English, + Japanese, + French, + German, + ); + mainGroup = 0867D691FE84028FC02AAC07 /* TiBeacons */; + productRefGroup = 034768DFFF38A50411DB9C8B /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D2AAC07D0554694100DB518D /* TiBeacons */, + 24416B8111C4CA220047AFDD /* Build & Test */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXShellScriptBuildPhase section */ + 24416B8011C4CA220047AFDD /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "# shell script goes here\n\npython \"${TITANIUM_SDK}/titanium.py\" run --dir=\"${PROJECT_DIR}\"\nexit $?\n"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + D2AAC07B0554694100DB518D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 24DD6CFA1134B3F500162E58 /* OrgBeuckmanTibeaconsModule.m in Sources */, + 24DE9E1211C5FE74003F90F6 /* OrgBeuckmanTibeaconsModuleAssets.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 24416B8511C4CA280047AFDD /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D2AAC07D0554694100DB518D /* TiBeacons */; + targetProxy = 24416B8411C4CA280047AFDD /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1DEB921F08733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DSTROOT = /tmp/OrgBeuckmanTibeacons.dst; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/joebeuckman/Documents/Titanium_Studio_Workspace/TiBeacons, + ); + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = OrgBeuckmanTibeacons_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = NO; + GCC_WARN_MISSING_PARENTHESES = NO; + GCC_WARN_SHADOW = NO; + GCC_WARN_STRICT_SELECTOR_MATCH = NO; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + INSTALL_PATH = /usr/local/lib; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = ( + "-DDEBUG", + "-DTI_POST_1_2", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = OrgBeuckmanTibeacons; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + RUN_CLANG_STATIC_ANALYZER = NO; + SDKROOT = iphoneos; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Debug; + }; + 1DEB922008733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; + DSTROOT = /tmp/OrgBeuckmanTibeacons.dst; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + /Users/joebeuckman/Documents/Titanium_Studio_Workspace/TiBeacons, + ); + GCC_C_LANGUAGE_STANDARD = c99; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = OrgBeuckmanTibeacons_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = NO; + GCC_WARN_MISSING_PARENTHESES = NO; + GCC_WARN_SHADOW = NO; + GCC_WARN_STRICT_SELECTOR_MATCH = NO; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + INSTALL_PATH = /usr/local/lib; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + LIBRARY_SEARCH_PATHS = ""; + OTHER_CFLAGS = "-DTI_POST_1_2"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = OrgBeuckmanTibeacons; + RUN_CLANG_STATIC_ANALYZER = NO; + SDKROOT = iphoneos; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Release; + }; + 1DEB922308733DC00010E9CD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DSTROOT = /tmp/OrgBeuckmanTibeacons.dst; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = OrgBeuckmanTibeacons_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = NO; + GCC_WARN_MISSING_PARENTHESES = NO; + GCC_WARN_SHADOW = NO; + GCC_WARN_STRICT_SELECTOR_MATCH = NO; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + INSTALL_PATH = /usr/local/lib; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + OTHER_CFLAGS = ( + "-DDEBUG", + "-DTI_POST_1_2", + ); + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = OrgBeuckmanTibeacons; + PROVISIONING_PROFILE = ""; + "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; + RUN_CLANG_STATIC_ANALYZER = NO; + SDKROOT = iphoneos; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Debug; + }; + 1DEB922408733DC00010E9CD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ENABLE_MODULES = YES; + DSTROOT = /tmp/OrgBeuckmanTibeacons.dst; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_MODEL_TUNING = G5; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = OrgBeuckmanTibeacons_Prefix.pch; + GCC_PREPROCESSOR_DEFINITIONS = "TI_VERSION=$(TI_VERSION)"; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; + GCC_VERSION = ""; + GCC_WARN_ABOUT_RETURN_TYPE = NO; + GCC_WARN_MISSING_PARENTHESES = NO; + GCC_WARN_SHADOW = NO; + GCC_WARN_STRICT_SELECTOR_MATCH = NO; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_PARAMETER = NO; + GCC_WARN_UNUSED_VALUE = NO; + GCC_WARN_UNUSED_VARIABLE = NO; + INSTALL_PATH = /usr/local/lib; + IPHONEOS_DEPLOYMENT_TARGET = 7.0; + OTHER_CFLAGS = "-DTI_POST_1_2"; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = OrgBeuckmanTibeacons; + RUN_CLANG_STATIC_ANALYZER = NO; + SDKROOT = iphoneos; + USER_HEADER_SEARCH_PATHS = ""; + }; + name = Release; + }; + 24416B8211C4CA220047AFDD /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + PRODUCT_NAME = "Build & test"; + }; + name = Debug; + }; + 24416B8311C4CA220047AFDD /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 24DD6D1B1134B66800162E58 /* titanium.xcconfig */; + buildSettings = { + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_ENABLE_FIX_AND_CONTINUE = NO; + PRODUCT_NAME = "Build & test"; + ZERO_LINK = NO; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1DEB921E08733DC00010E9CD /* Build configuration list for PBXNativeTarget "TiBeacons" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB921F08733DC00010E9CD /* Debug */, + 1DEB922008733DC00010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "TiBeacons" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1DEB922308733DC00010E9CD /* Debug */, + 1DEB922408733DC00010E9CD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 24416B8A11C4CA520047AFDD /* Build configuration list for PBXAggregateTarget "Build & Test" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 24416B8211C4CA220047AFDD /* Debug */, + 24416B8311C4CA220047AFDD /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 0867D690FE84028FC02AAC07 /* Project object */; +} diff --git a/TiBeacons.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/TiBeacons.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..3e68148 --- /dev/null +++ b/TiBeacons.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/TiBeacons.xcodeproj/project.xcworkspace/xcuserdata/joebeuckman.xcuserdatad/UserInterfaceState.xcuserstate b/TiBeacons.xcodeproj/project.xcworkspace/xcuserdata/joebeuckman.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..14a6005 Binary files /dev/null and b/TiBeacons.xcodeproj/project.xcworkspace/xcuserdata/joebeuckman.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TiBeacons.xcodeproj/xcuserdata/joebeuckman.xcuserdatad/xcschemes/Build & Test.xcscheme b/TiBeacons.xcodeproj/xcuserdata/joebeuckman.xcuserdatad/xcschemes/Build & Test.xcscheme new file mode 100644 index 0000000..046500f --- /dev/null +++ b/TiBeacons.xcodeproj/xcuserdata/joebeuckman.xcuserdatad/xcschemes/Build & Test.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TiBeacons.xcodeproj/xcuserdata/joebeuckman.xcuserdatad/xcschemes/TiBeacons.xcscheme b/TiBeacons.xcodeproj/xcuserdata/joebeuckman.xcuserdatad/xcschemes/TiBeacons.xcscheme new file mode 100644 index 0000000..078b48b --- /dev/null +++ b/TiBeacons.xcodeproj/xcuserdata/joebeuckman.xcuserdatad/xcschemes/TiBeacons.xcscheme @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TiBeacons.xcodeproj/xcuserdata/joebeuckman.xcuserdatad/xcschemes/xcschememanagement.plist b/TiBeacons.xcodeproj/xcuserdata/joebeuckman.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..6e11fb6 --- /dev/null +++ b/TiBeacons.xcodeproj/xcuserdata/joebeuckman.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + Build & Test.xcscheme + + orderHint + 1 + + TiBeacons.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 24416B8111C4CA220047AFDD + + primary + + + D2AAC07D0554694100DB518D + + primary + + + + + diff --git a/assets/README b/assets/README new file mode 100644 index 0000000..e643938 --- /dev/null +++ b/assets/README @@ -0,0 +1,6 @@ +Place your assets like PNG files in this directory and they will be packaged with your module. + +If you create a file named org.beuckman.tibeacons.js in this directory, it will be +compiled and used as your module. This allows you to run pure Javascript +modules that are pre-compiled. + diff --git a/build.py b/build.py new file mode 100755 index 0000000..ab0adc6 --- /dev/null +++ b/build.py @@ -0,0 +1,223 @@ +#!/usr/bin/env python +# +# Appcelerator Titanium Module Packager +# +# +import os, subprocess, sys, glob, string +import zipfile +from datetime import date + +cwd = os.path.abspath(os.path.dirname(sys._getframe(0).f_code.co_filename)) +os.chdir(cwd) +required_module_keys = ['name','version','moduleid','description','copyright','license','copyright','platform','minsdk'] +module_defaults = { + 'description':'My module', + 'author': 'Your Name', + 'license' : 'Specify your license', + 'copyright' : 'Copyright (c) %s by Your Company' % str(date.today().year), +} +module_license_default = "TODO: place your license here and we'll include it in the module distribution" + +def find_sdk(config): + sdk = config['TITANIUM_SDK'] + return os.path.expandvars(os.path.expanduser(sdk)) + +def replace_vars(config,token): + idx = token.find('$(') + while idx != -1: + idx2 = token.find(')',idx+2) + if idx2 == -1: break + key = token[idx+2:idx2] + if not config.has_key(key): break + token = token.replace('$(%s)' % key, config[key]) + idx = token.find('$(') + return token + + +def read_ti_xcconfig(): + contents = open(os.path.join(cwd,'titanium.xcconfig')).read() + config = {} + for line in contents.splitlines(False): + line = line.strip() + if line[0:2]=='//': continue + idx = line.find('=') + if idx > 0: + key = line[0:idx].strip() + value = line[idx+1:].strip() + config[key] = replace_vars(config,value) + return config + +def generate_doc(config): + docdir = os.path.join(cwd,'documentation') + if not os.path.exists(docdir): + print "Couldn't find documentation file at: %s" % docdir + return None + + try: + import markdown2 as markdown + except ImportError: + import markdown + documentation = [] + for file in os.listdir(docdir): + if file in ignoreFiles or os.path.isdir(os.path.join(docdir, file)): + continue + md = open(os.path.join(docdir,file)).read() + html = markdown.markdown(md) + documentation.append({file:html}); + return documentation + +def compile_js(manifest,config): + js_file = os.path.join(cwd,'assets','org.beuckman.tibeacons.js') + if not os.path.exists(js_file): return + + from compiler import Compiler + try: + import json + except: + import simplejson as json + + compiler = Compiler(cwd, manifest['moduleid'], manifest['name'], 'commonjs') + root_asset, module_assets = compiler.compile_module() + + root_asset_content = """ +%s + + return filterDataInRange([NSData dataWithBytesNoCopy:data length:sizeof(data) freeWhenDone:NO], ranges[0]); +""" % root_asset + + module_asset_content = """ +%s + + NSNumber *index = [map objectForKey:path]; + if (index == nil) { + return nil; + } + return filterDataInRange([NSData dataWithBytesNoCopy:data length:sizeof(data) freeWhenDone:NO], ranges[index.integerValue]); +""" % module_assets + + from tools import splice_code + + assets_router = os.path.join(cwd,'Classes','OrgBeuckmanTibeaconsModuleAssets.m') + splice_code(assets_router, 'asset', root_asset_content) + splice_code(assets_router, 'resolve_asset', module_asset_content) + + # Generate the exports after crawling all of the available JS source + exports = open('metadata.json','w') + json.dump({'exports':compiler.exports }, exports) + exports.close() + +def die(msg): + print msg + sys.exit(1) + +def warn(msg): + print "[WARN] %s" % msg + +def validate_license(): + c = open(os.path.join(cwd,'LICENSE')).read() + if c.find(module_license_default)!=-1: + warn('please update the LICENSE file with your license text before distributing') + +def validate_manifest(): + path = os.path.join(cwd,'manifest') + f = open(path) + if not os.path.exists(path): die("missing %s" % path) + manifest = {} + for line in f.readlines(): + line = line.strip() + if line[0:1]=='#': continue + if line.find(':') < 0: continue + key,value = line.split(':') + manifest[key.strip()]=value.strip() + for key in required_module_keys: + if not manifest.has_key(key): die("missing required manifest key '%s'" % key) + if module_defaults.has_key(key): + defvalue = module_defaults[key] + curvalue = manifest[key] + if curvalue==defvalue: warn("please update the manifest key: '%s' to a non-default value" % key) + return manifest,path + +ignoreFiles = ['.DS_Store','.gitignore','libTitanium.a','titanium.jar','README'] +ignoreDirs = ['.DS_Store','.svn','.git','CVSROOT'] + +def zip_dir(zf,dir,basepath,ignoreExt=[]): + if not os.path.exists(dir): return + for root, dirs, files in os.walk(dir): + for name in ignoreDirs: + if name in dirs: + dirs.remove(name) # don't visit ignored directories + for file in files: + if file in ignoreFiles: continue + e = os.path.splitext(file) + if len(e) == 2 and e[1] in ignoreExt: continue + from_ = os.path.join(root, file) + to_ = from_.replace(dir, '%s/%s'%(basepath,dir), 1) + zf.write(from_, to_) + +def glob_libfiles(): + files = [] + for libfile in glob.glob('build/**/*.a'): + if libfile.find('Release-')!=-1: + files.append(libfile) + return files + +def build_module(manifest,config): + from tools import ensure_dev_path + ensure_dev_path() + + rc = os.system("xcodebuild -sdk iphoneos -configuration Release") + if rc != 0: + die("xcodebuild failed") + rc = os.system("xcodebuild -sdk iphonesimulator -configuration Release") + if rc != 0: + die("xcodebuild failed") + # build the merged library using lipo + moduleid = manifest['moduleid'] + libpaths = '' + for libfile in glob_libfiles(): + libpaths+='%s ' % libfile + + os.system("lipo %s -create -output build/lib%s.a" %(libpaths,moduleid)) + +def package_module(manifest,mf,config): + name = manifest['name'].lower() + moduleid = manifest['moduleid'].lower() + version = manifest['version'] + modulezip = '%s-iphone-%s.zip' % (moduleid,version) + if os.path.exists(modulezip): os.remove(modulezip) + zf = zipfile.ZipFile(modulezip, 'w', zipfile.ZIP_DEFLATED) + modulepath = 'modules/iphone/%s/%s' % (moduleid,version) + zf.write(mf,'%s/manifest' % modulepath) + libname = 'lib%s.a' % moduleid + zf.write('build/%s' % libname, '%s/%s' % (modulepath,libname)) + docs = generate_doc(config) + if docs!=None: + for doc in docs: + for file, html in doc.iteritems(): + filename = string.replace(file,'.md','.html') + zf.writestr('%s/documentation/%s'%(modulepath,filename),html) + zip_dir(zf,'assets',modulepath,['.pyc','.js']) + zip_dir(zf,'example',modulepath,['.pyc']) + zip_dir(zf,'platform',modulepath,['.pyc','.js']) + zf.write('LICENSE','%s/LICENSE' % modulepath) + zf.write('module.xcconfig','%s/module.xcconfig' % modulepath) + exports_file = 'metadata.json' + if os.path.exists(exports_file): + zf.write(exports_file, '%s/%s' % (modulepath, exports_file)) + zf.close() + + +if __name__ == '__main__': + manifest,mf = validate_manifest() + validate_license() + config = read_ti_xcconfig() + + sdk = find_sdk(config) + sys.path.insert(0,os.path.join(sdk,'iphone')) + sys.path.append(os.path.join(sdk, "common")) + + compile_js(manifest,config) + build_module(manifest,config) + package_module(manifest,mf,config) + sys.exit(0) + diff --git a/documentation/index.md b/documentation/index.md new file mode 100644 index 0000000..2afcdaa --- /dev/null +++ b/documentation/index.md @@ -0,0 +1,39 @@ +# TiBeacons Module + +## Description + +TODO: Enter your module description here + +## Accessing the TiBeacons Module + +To access this module from JavaScript, you would do the following: + + var TiBeacons = require("org.beuckman.tibeacons"); + +The TiBeacons variable is a reference to the Module object. + +## Reference + +TODO: If your module has an API, you should document +the reference here. + +### ___PROJECTNAMEASIDENTIFIER__.function + +TODO: This is an example of a module function. + +### ___PROJECTNAMEASIDENTIFIER__.property + +TODO: This is an example of a module property. + +## Usage + +TODO: Enter your usage example here + +## Author + +TODO: Enter your author name, email and other contact +details you want to share here. + +## License + +TODO: Enter your license/legal information here. diff --git a/example/app.js b/example/app.js new file mode 100644 index 0000000..ac21c0e --- /dev/null +++ b/example/app.js @@ -0,0 +1,34 @@ + + +// open a single window +var win = Ti.UI.createWindow({ + backgroundColor:'white' +}); +var label = Ti.UI.createLabel(); +win.add(label); +win.open(); + + +var TiBeacons = require('org.beuckman.tibeacons'); +Ti.API.info("module is => " + TiBeacons); + + +// handle the results from ranging (below) +TiBeacons.addEventListener("didRangeBeacons", function(obj){ + Ti.API.info(obj); +}); + + +// look for iBeacons +TiBeacons.startRangingForBeacons({ + uuid: "00000000-0000-0000-0000-000000000000", + identifier: "TiBeacon Test" +}); + + +// or if you want to be an iBeacon +TiBeacons.startAdvertisingBeacon({ + uuid: "00000000-0000-0000-0000-000000000000", + identifier: "TiBeacon Test" +}); + diff --git a/hooks/README b/hooks/README new file mode 100644 index 0000000..66b10a8 --- /dev/null +++ b/hooks/README @@ -0,0 +1 @@ +These files are not yet supported as of 1.4.0 but will be in a near future release. diff --git a/hooks/add.py b/hooks/add.py new file mode 100644 index 0000000..04e1c1d --- /dev/null +++ b/hooks/add.py @@ -0,0 +1,35 @@ +#!/usr/bin/env python +# +# This is the module project add hook that will be +# called when your module is added to a project +# +import os, sys + +def dequote(s): + if s[0:1] == '"': + return s[1:-1] + return s + +def main(args,argc): + # You will get the following command line arguments + # in the following order: + # + # project_dir = the full path to the project root directory + # project_type = the type of project (desktop, mobile, ipad) + # project_name = the name of the project + # + project_dir = dequote(os.path.expanduser(args[1])) + project_type = dequote(args[2]) + project_name = dequote(args[3]) + + # TODO: write your add hook here (optional) + + + # exit + sys.exit(0) + + + +if __name__ == '__main__': + main(sys.argv,len(sys.argv)) + diff --git a/hooks/install.py b/hooks/install.py new file mode 100644 index 0000000..b423fe9 --- /dev/null +++ b/hooks/install.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# +# This is the module install hook that will be +# called when your module is first installed +# +import os, sys + +def main(args,argc): + + # TODO: write your install hook here (optional) + + # exit + sys.exit(0) + + + +if __name__ == '__main__': + main(sys.argv,len(sys.argv)) + diff --git a/hooks/remove.py b/hooks/remove.py new file mode 100644 index 0000000..f92a234 --- /dev/null +++ b/hooks/remove.py @@ -0,0 +1,34 @@ +#!/usr/bin/env python +# +# This is the module project remove hook that will be +# called when your module is remove from a project +# +import os, sys + +def dequote(s): + if s[0:1] == '"': + return s[1:-1] + return s + +def main(args,argc): + # You will get the following command line arguments + # in the following order: + # + # project_dir = the full path to the project root directory + # project_type = the type of project (desktop, mobile, ipad) + # project_name = the name of the project + # + project_dir = dequote(os.path.expanduser(args[1])) + project_type = dequote(args[2]) + project_name = dequote(args[3]) + + # TODO: write your remove hook here (optional) + + # exit + sys.exit(0) + + + +if __name__ == '__main__': + main(sys.argv,len(sys.argv)) + diff --git a/hooks/uninstall.py b/hooks/uninstall.py new file mode 100644 index 0000000..a7ffd91 --- /dev/null +++ b/hooks/uninstall.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python +# +# This is the module uninstall hook that will be +# called when your module is uninstalled +# +import os, sys + +def main(args,argc): + + # TODO: write your uninstall hook here (optional) + + # exit + sys.exit(0) + + +if __name__ == '__main__': + main(sys.argv,len(sys.argv)) + diff --git a/manifest b/manifest new file mode 100644 index 0000000..bfd6bc4 --- /dev/null +++ b/manifest @@ -0,0 +1,18 @@ +# +# this is your module manifest and used by Titanium +# during compilation, packaging, distribution, etc. +# +version: 0.1 +apiversion: 2 +description: Implements iBeacon interface as in (nicktoumpelis) HiBeacons +author: Joe Beuckman +license: No +copyright: No + + +# these should not be edited +name: TiBeacons +moduleid: org.beuckman.tibeacons +guid: 8d388e36-9093-4df8-a4d3-1db3621f04c0 +platform: iphone +minsdk: 3.1.3.GA diff --git a/manifest~ b/manifest~ new file mode 100644 index 0000000..4611a08 --- /dev/null +++ b/manifest~ @@ -0,0 +1,18 @@ +# +# this is your module manifest and used by Titanium +# during compilation, packaging, distribution, etc. +# +version: 0.1 +apiversion: 2 +description: Implements iBeacon interface as in https\://github.com/nicktoumpelis/HiBeacons +author: Joe Beuckman +license: No +copyright: No + + +# these should not be edited +name: TiBeacons +moduleid: org.beuckman.tibeacons +guid: 8d388e36-9093-4df8-a4d3-1db3621f04c0 +platform: iphone +minsdk: 3.1.3.GA diff --git a/module.xcconfig b/module.xcconfig new file mode 100644 index 0000000..beefd9e --- /dev/null +++ b/module.xcconfig @@ -0,0 +1,31 @@ +// +// PLACE ANY BUILD DEFINITIONS IN THIS FILE AND THEY WILL BE +// PICKED UP DURING THE APP BUILD FOR YOUR MODULE +// +// see the following webpage for instructions on the settings +// for this file: +// http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/XcodeBuildSystem/400-Build_Configurations/build_configs.html +// + +// +// How to add a Framework (example) +// +// OTHER_LDFLAGS=$(inherited) -framework Foo +// +// Adding a framework for a specific version(s) of iPhone: + + +OTHER_LDFLAGS=$(inherited) -framework CoreLocation -framework CoreBluetooth + +// +// OTHER_LDFLAGS[sdk=iphoneos4*]=$(inherited) -framework Foo +// OTHER_LDFLAGS[sdk=iphonesimulator4*]=$(inherited) -framework Foo +// +// +// How to add a compiler define: +// +// OTHER_CFLAGS=$(inherited) -DFOO=1 +// +// +// IMPORTANT NOTE: always use $(inherited) in your overrides +// diff --git a/platform/README b/platform/README new file mode 100644 index 0000000..7ac991c --- /dev/null +++ b/platform/README @@ -0,0 +1,3 @@ +You can place platform-specific files here in sub-folders named "android" and/or "iphone", just as you can with normal Titanium Mobile SDK projects. Any folders and files you place here will be merged with the platform-specific files in a Titanium Mobile project that uses this module. + +When a Titanium Mobile project that uses this module is built, the files from this platform/ folder will be treated the same as files (if any) from the Titanium Mobile project's platform/ folder. diff --git a/timodule.xml b/timodule.xml new file mode 100644 index 0000000..6affb2f --- /dev/null +++ b/timodule.xml @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/titanium.xcconfig b/titanium.xcconfig new file mode 100644 index 0000000..6a6bd4a --- /dev/null +++ b/titanium.xcconfig @@ -0,0 +1,19 @@ +// +// +// CHANGE THESE VALUES TO REFLECT THE VERSION (AND LOCATION IF DIFFERENT) +// OF YOUR TITANIUM SDK YOU'RE BUILDING FOR +// +// +TITANIUM_SDK_VERSION = 3.1.3.GA + + +// +// THESE SHOULD BE OK GENERALLY AS-IS +// +TITANIUM_SDK = ~/Library/Application Support/Titanium/mobilesdk/osx/$(TITANIUM_SDK_VERSION) +TITANIUM_BASE_SDK = "$(TITANIUM_SDK)/iphone/include" +TITANIUM_BASE_SDK2 = "$(TITANIUM_SDK)/iphone/include/TiCore" +HEADER_SEARCH_PATHS= $(TITANIUM_BASE_SDK) $(TITANIUM_BASE_SDK2) + + +