diff --git a/Airship/Common/UAActionArguments.h b/Airship/Common/UAActionArguments.h index 9723fee04..ff9d0050c 100644 --- a/Airship/Common/UAActionArguments.h +++ b/Airship/Common/UAActionArguments.h @@ -25,8 +25,6 @@ #import -#define kPendingPushActionDefaultsKey @"com.urbanairship.action.pending" - /** * Represents the possible situations. */ diff --git a/Airship/Common/UAActionRegistry.m b/Airship/Common/UAActionRegistry.m index e8aeaa7ef..46e132adc 100644 --- a/Airship/Common/UAActionRegistry.m +++ b/Airship/Common/UAActionRegistry.m @@ -268,7 +268,7 @@ - (void)registerDefaultActions { // Incoming in-app message action UAIncomingInAppMessageAction *iamAction = [[UAIncomingInAppMessageAction alloc] init]; [self registerReservedAction:iamAction name:kUAIncomingInAppMessageActionDefaultRegistryName predicate:^(UAActionArguments *args){ - IF_IOS7_OR_GREATER(return YES;) + UA_IF_IOS7_OR_GREATER(return YES;) // In-App Messages will not work on iOS 6 or below return NO; diff --git a/Airship/Common/UAConfig.m b/Airship/Common/UAConfig.m index efea518cb..c304838b9 100644 --- a/Airship/Common/UAConfig.m +++ b/Airship/Common/UAConfig.m @@ -38,8 +38,8 @@ - (void)dealloc { - (instancetype)init { self = [super init]; if (self) { - self.deviceAPIURL = kAirshipProductionServer; - self.analyticsURL = kAnalyticsProductionServer; + self.deviceAPIURL = kUAAirshipProductionServer; + self.analyticsURL = kUAAnalyticsProductionServer; self.landingPageContentURL = kUAProductionLandingPageContentURL; self.developmentLogLevel = UALogLevelDebug; self.productionLogLevel = UALogLevelError; diff --git a/Airship/Common/UAEvent.h b/Airship/Common/UAEvent.h index b6a674ab5..214549f47 100644 --- a/Airship/Common/UAEvent.h +++ b/Airship/Common/UAEvent.h @@ -26,11 +26,11 @@ #import #import -#define kEventAppInitSize (NSUInteger) 450//397 w/ push ID, no inbox ID -#define kEventAppExitSize (NSUInteger) 200//136 w/ only network type +#define kUAEventAppInitSize (NSUInteger) 450//397 w/ push ID, no inbox ID +#define kUAEventAppExitSize (NSUInteger) 200//136 w/ only network type -#define kEventDeviceRegistrationSize (NSUInteger) 200//153 w/ only user info -#define kEventPushReceivedSize (NSUInteger) 200//160 w/ uuid push info +#define kUAEventDeviceRegistrationSize (NSUInteger) 200//153 w/ only user info +#define kUAEventPushReceivedSize (NSUInteger) 200//160 w/ uuid push info /** * This base class encapsulates analytics events. diff --git a/Airship/Common/UAEventAppExit.m b/Airship/Common/UAEventAppExit.m index 731492179..901a4cd4b 100644 --- a/Airship/Common/UAEventAppExit.m +++ b/Airship/Common/UAEventAppExit.m @@ -52,7 +52,7 @@ - (NSString *)eventType { } - (NSUInteger)estimatedSize { - return kEventAppExitSize; + return kUAEventAppExitSize; } @end diff --git a/Airship/Common/UAEventAppInit.m b/Airship/Common/UAEventAppInit.m index 09fa10232..d8fe18cef 100644 --- a/Airship/Common/UAEventAppInit.m +++ b/Airship/Common/UAEventAppInit.m @@ -76,7 +76,7 @@ - (NSString *)eventType { } - (NSUInteger)estimatedSize { - return kEventAppInitSize; + return kUAEventAppInitSize; } @end diff --git a/Airship/Common/UAEventDeviceRegistration.m b/Airship/Common/UAEventDeviceRegistration.m index 9b027331b..f9833592a 100644 --- a/Airship/Common/UAEventDeviceRegistration.m +++ b/Airship/Common/UAEventDeviceRegistration.m @@ -49,7 +49,7 @@ - (NSString *)eventType { } - (NSUInteger)estimatedSize { - return kEventDeviceRegistrationSize; + return kUAEventDeviceRegistrationSize; } @end diff --git a/Airship/Common/UAEventPushReceived.m b/Airship/Common/UAEventPushReceived.m index 0c155dfbf..733022570 100644 --- a/Airship/Common/UAEventPushReceived.m +++ b/Airship/Common/UAEventPushReceived.m @@ -56,7 +56,7 @@ - (NSString *)eventType { } - (NSUInteger)estimatedSize { - return kEventPushReceivedSize; + return kUAEventPushReceivedSize; } @end diff --git a/Airship/Common/UAGlobal.h b/Airship/Common/UAGlobal.h index 2e24c2832..d83f3a1bc 100644 --- a/Airship/Common/UAGlobal.h +++ b/Airship/Common/UAGlobal.h @@ -100,8 +100,8 @@ extern UALogLevel uaLogLevel; // Default is UALogLevelError #define UALOG UA_LDEBUG // constants -#define kAirshipProductionServer @"https://device-api.urbanairship.com" -#define kAnalyticsProductionServer @"https://combine.urbanairship.com" +#define kUAAirshipProductionServer @"https://device-api.urbanairship.com" +#define kUAAnalyticsProductionServer @"https://combine.urbanairship.com" #define kUAProductionLandingPageContentURL @"https://dl.urbanairship.com/aaa" #ifdef _UA_VERSION @@ -124,13 +124,13 @@ return VERSION_STR; \ @end #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 70000 -#define IF_IOS7_OR_GREATER(...) \ +#define UA_IF_IOS7_OR_GREATER(...) \ if (kCFCoreFoundationVersionNumber >= kCFCoreFoundationVersionNumber_iOS_7_0) \ { \ __VA_ARGS__ \ } #else -#define IF_IOS_7_OR_GREATER(...) +#define UA_IF_IOS7_OR_GREATER(...) #endif #define UA_SUPPRESS_PERFORM_SELECTOR_LEAK_WARNING(THE_CODE) \ diff --git a/Airship/Common/UAShareAction.m b/Airship/Common/UAShareAction.m index 97dc4c2b8..a00018cf2 100644 --- a/Airship/Common/UAShareAction.m +++ b/Airship/Common/UAShareAction.m @@ -45,7 +45,7 @@ - (BOOL)acceptsArguments:(UAActionArguments *)arguments { return NO; } - IF_IOS7_OR_GREATER(return YES;) + UA_IF_IOS7_OR_GREATER(return YES;) // Reject if on iOS 6.x (unsupported). return NO; diff --git a/Airship/Inbox/UAInboxDBManager.h b/Airship/Inbox/UAInboxDBManager.h index c5be0e851..5f769e6e1 100644 --- a/Airship/Inbox/UAInboxDBManager.h +++ b/Airship/Inbox/UAInboxDBManager.h @@ -30,10 +30,10 @@ @class UAInboxMessage; @class UAConfig; -#define OLD_DB_NAME @"UAInbox.db" +#define UA_OLD_DB_NAME @"UAInbox.db" -#define CORE_DATA_STORE_NAME @"Inbox-%@.sqlite" -#define CORE_DATA_DIRECTORY_NAME @"UAInbox" +#define UA_CORE_DATA_STORE_NAME @"Inbox-%@.sqlite" +#define UA_CORE_DATA_DIRECTORY_NAME @"UAInbox" /** * The UAInboxDBManager singleton provides access to the Rich Push Inbox data. diff --git a/Airship/Inbox/UAInboxDBManager.m b/Airship/Inbox/UAInboxDBManager.m index ba89ea06a..533bc34fd 100644 --- a/Airship/Inbox/UAInboxDBManager.m +++ b/Airship/Inbox/UAInboxDBManager.m @@ -37,7 +37,7 @@ @implementation UAInboxDBManager - (instancetype)initWithConfig:(UAConfig *)config { self = [super init]; if (self) { - NSString *databaseName = [NSString stringWithFormat:CORE_DATA_STORE_NAME, config.appKey]; + NSString *databaseName = [NSString stringWithFormat:UA_CORE_DATA_STORE_NAME, config.appKey]; self.storeURL = [[self createStoreURL] URLByAppendingPathComponent:databaseName]; // Delete the old directory if it exists @@ -258,7 +258,7 @@ - (void)updateMessage:(UAInboxMessage *)message withDictionary:(NSDictionary *)d - (void)deleteOldDatabaseIfExists { NSArray *libraryDirectories = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); NSString *libraryDirectory = [libraryDirectories objectAtIndex:0]; - NSString *dbPath = [libraryDirectory stringByAppendingPathComponent:OLD_DB_NAME]; + NSString *dbPath = [libraryDirectory stringByAppendingPathComponent:UA_OLD_DB_NAME]; if ([[NSFileManager defaultManager] fileExistsAtPath:dbPath]) { [[NSFileManager defaultManager] removeItemAtPath:dbPath error:nil]; @@ -300,7 +300,7 @@ - (NSURL *)createStoreURL { NSFileManager *fm = [NSFileManager defaultManager]; NSURL *libraryDirectoryURL = [[fm URLsForDirectory:NSLibraryDirectory inDomains:NSUserDomainMask] lastObject]; - NSURL *directoryURL = [libraryDirectoryURL URLByAppendingPathComponent: CORE_DATA_DIRECTORY_NAME]; + NSURL *directoryURL = [libraryDirectoryURL URLByAppendingPathComponent: UA_CORE_DATA_DIRECTORY_NAME]; // Create the store directory if it doesnt exist if (![fm fileExistsAtPath:[directoryURL path]]) { diff --git a/AirshipLib/AirshipLogicTests/UAEventTest.m b/AirshipLib/AirshipLogicTests/UAEventTest.m index e49e8db0c..6cd6153f6 100644 --- a/AirshipLib/AirshipLogicTests/UAEventTest.m +++ b/AirshipLib/AirshipLogicTests/UAEventTest.m @@ -140,7 +140,7 @@ - (void)testAppInitEvent { UAEventAppInit *event = [UAEventAppInit event]; XCTAssertEqualObjects(event.data, expectedData, @"Event data is unexpected."); XCTAssertEqualObjects(event.eventType, @"app_init", @"Event type is unexpected."); - XCTAssertEqual(event.estimatedSize, kEventAppInitSize, @"Event is reporting wrong estimated size."); + XCTAssertEqual(event.estimatedSize, kUAEventAppInitSize, @"Event is reporting wrong estimated size."); XCTAssertNotNil(event.eventID, @"Event should have an ID"); } @@ -177,7 +177,7 @@ - (void)testAppForegroundEvent { UAEventAppForeground *event = [UAEventAppForeground event]; XCTAssertEqualObjects(event.data, expectedData, @"Event data is unexpected."); XCTAssertEqualObjects(event.eventType, @"app_foreground", @"Event type is unexpected."); - XCTAssertEqual(event.estimatedSize, kEventAppInitSize, @"Event is reporting wrong estimated size."); + XCTAssertEqual(event.estimatedSize, kUAEventAppInitSize, @"Event is reporting wrong estimated size."); XCTAssertNotNil(event.eventID, @"Event should have an ID"); } @@ -198,7 +198,7 @@ - (void)testAppExitEvent { UAEventAppExit *event = [UAEventAppExit event]; XCTAssertEqualObjects(event.data, expectedData, @"Event data is unexpected."); XCTAssertEqualObjects(event.eventType, @"app_exit", @"Event type is unexpected."); - XCTAssertEqual(event.estimatedSize, kEventAppExitSize, @"Event is reporting wrong estimated size."); + XCTAssertEqual(event.estimatedSize, kUAEventAppExitSize, @"Event is reporting wrong estimated size."); XCTAssertNotNil(event.eventID, @"Event should have an ID"); } @@ -211,7 +211,7 @@ - (void)UAEventAppBackground { UAEventAppBackground *event = [UAEventAppBackground event]; XCTAssertEqualObjects(event.data, expectedData, @"Event data is unexpected."); XCTAssertEqualObjects(event.eventType, @"app_background", @"Event type is unexpected."); - XCTAssertEqual(event.estimatedSize, kEventAppExitSize, @"Event is reporting wrong estimated size."); + XCTAssertEqual(event.estimatedSize, kUAEventAppExitSize, @"Event is reporting wrong estimated size."); XCTAssertNotNil(event.eventID, @"Event should have an ID"); } @@ -230,7 +230,7 @@ - (void)testRegistrationEvent { UAEventDeviceRegistration *event = [UAEventDeviceRegistration event]; XCTAssertEqualObjects(event.data, expectedData, @"Event data is unexpected."); XCTAssertEqualObjects(event.eventType, @"device_registration", @"Event type is unexpected."); - XCTAssertEqual(event.estimatedSize, kEventDeviceRegistrationSize, @"Event is reporting wrong estimated size."); + XCTAssertEqual(event.estimatedSize, kUAEventDeviceRegistrationSize, @"Event is reporting wrong estimated size."); XCTAssertNotNil(event.eventID, @"Event should have an ID"); } @@ -249,7 +249,7 @@ - (void)testPushReceivedEvent { UAEventPushReceived *event = [UAEventPushReceived eventWithNotification:notification]; XCTAssertEqualObjects(event.data, expectedData, @"Event data is unexpected."); XCTAssertEqualObjects(event.eventType, @"push_received", @"Event type is unexpected."); - XCTAssertEqual(event.estimatedSize, kEventPushReceivedSize, @"Event is reporting wrong estimated size."); + XCTAssertEqual(event.estimatedSize, kUAEventPushReceivedSize, @"Event is reporting wrong estimated size."); XCTAssertNotNil(event.eventID, @"Event should have an ID"); } diff --git a/TestCommon/LocationTest/UALocationTestUtils.h b/TestCommon/LocationTest/UALocationTestUtils.h index b3ddf0ede..0a97f8463 100644 --- a/TestCommon/LocationTest/UALocationTestUtils.h +++ b/TestCommon/LocationTest/UALocationTestUtils.h @@ -25,15 +25,15 @@ #import -#define kTestLatPDX 45.525352839897 -#define kTestLongPDX -122.682115697712 -#define kTestLatSFO 37.772643 -#define kTestLongSFO -122.406095 -#define kTestAlt 100.0 -#define kTestHorizontalAccuracy 5.0 -#define kTestVerticalAccuracy 5.0 -#define kTestDistanceFilter 10.0 -#define kTestDesiredAccuracy 5.0 +#define kUATestLatPDX 45.525352839897 +#define kUATestLongPDX -122.682115697712 +#define kUATestLatSFO 37.772643 +#define kUATestLongSFO -122.406095 +#define kUATestAlt 100.0 +#define kUATestHorizontalAccuracy 5.0 +#define kUATestVerticalAccuracy 5.0 +#define kUATestDistanceFilter 10.0 +#define kUATestDesiredAccuracy 5.0 @interface UALocationTestUtils : NSObject diff --git a/TestCommon/LocationTest/UALocationTestUtils.m b/TestCommon/LocationTest/UALocationTestUtils.m index a1f0fdc73..087c9d8ef 100644 --- a/TestCommon/LocationTest/UALocationTestUtils.m +++ b/TestCommon/LocationTest/UALocationTestUtils.m @@ -28,21 +28,21 @@ @implementation UALocationTestUtils + (CLLocation *)testLocationPDX { - CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(kTestLatPDX, kTestLongPDX); + CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(kUATestLatPDX, kUATestLongPDX); CLLocation *location = [[CLLocation alloc] initWithCoordinate:coord - altitude:kTestAlt - horizontalAccuracy:kTestHorizontalAccuracy - verticalAccuracy:kTestVerticalAccuracy + altitude:kUATestAlt + horizontalAccuracy:kUATestHorizontalAccuracy + verticalAccuracy:kUATestVerticalAccuracy timestamp:[NSDate date]]; return location; } + (CLLocation *)testLocationSFO { - CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(kTestLatSFO, kTestLongSFO); + CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(kUATestLatSFO, kUATestLongSFO); CLLocation *location = [[CLLocation alloc] initWithCoordinate:coord - altitude:kTestAlt - horizontalAccuracy:kTestHorizontalAccuracy - verticalAccuracy:kTestVerticalAccuracy + altitude:kUATestAlt + horizontalAccuracy:kUATestHorizontalAccuracy + verticalAccuracy:kUATestVerticalAccuracy timestamp:[NSDate date]]; return location; } @@ -50,8 +50,8 @@ + (CLLocation *)testLocationSFO { + (CLLocationManager *)testLocationManager { CLLocationManager *manager = [[CLLocationManager alloc] init]; - manager.desiredAccuracy = kTestDesiredAccuracy; - manager.distanceFilter = kTestDistanceFilter; + manager.desiredAccuracy = kUATestDesiredAccuracy; + manager.distanceFilter = kUATestDistanceFilter; return manager; } @end