diff --git a/UnitTests/MPBackendControllerTests.m b/UnitTests/MPBackendControllerTests.m index 01260035..3b13da90 100644 --- a/UnitTests/MPBackendControllerTests.m +++ b/UnitTests/MPBackendControllerTests.m @@ -51,7 +51,7 @@ + (dispatch_queue_t)messageQueue; @property (nonatomic, strong, nonnull) MPBackendController_PRIVATE *backendController; @property (nonatomic, strong) MPPersistenceController *persistenceController; @property (nonatomic, strong) MPStateMachine_PRIVATE *stateMachine; -@property (nonatomic, strong) MPKitContainer *kitContainer; +@property (nonatomic, strong) MPKitContainer_PRIVATE *kitContainer; @property (nonatomic, strong, nullable) NSString *dataPlanId; @property (nonatomic, strong, nullable) NSNumber *dataPlanVersion; @property (nonatomic, strong, nonnull) MParticleOptions *options; @@ -59,7 +59,7 @@ + (dispatch_queue_t)messageQueue; @end #pragma mark - MPKitContainer category for unit tests -@interface MPKitContainer(Tests) +@interface MPKitContainer_PRIVATE(Tests) - (id)startKit:(NSNumber *)integrationId configuration:(MPKitConfiguration *)kitConfiguration; @@ -121,7 +121,7 @@ - (void)setUp { [MParticle sharedInstance].stateMachine.apiKey = @"unit_test_app_key"; [MParticle sharedInstance].stateMachine.secret = @"unit_test_secret"; - [MParticle sharedInstance].kitContainer = [[MPKitContainer alloc] init]; + [MParticle sharedInstance].kitContainer = [[MPKitContainer_PRIVATE alloc] init]; [MParticle sharedInstance].backendController = [[MPBackendController_PRIVATE alloc] initWithDelegate:(id)[MParticle sharedInstance]]; self.backendController = [MParticle sharedInstance].backendController; @@ -1058,12 +1058,12 @@ - (void)testSetUserTagFromUser { } - (void)testSetUserAttributeKits { - if (![MPKitContainer registeredKits]) { + if (![MPKitContainer_PRIVATE registeredKits]) { MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"KitTest" className:@"MPKitTestClassNoStartImmediately"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; kitRegister = [[MPKitRegister alloc] initWithName:@"KitSecondTest" className:@"MPKitSecondTestClass"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; NSDictionary *configuration1 = @{ @"id":@42, diff --git a/UnitTests/MPIUserDefaultsTests.m b/UnitTests/MPIUserDefaultsTests.m index d6ed2846..47fd3f07 100644 --- a/UnitTests/MPIUserDefaultsTests.m +++ b/UnitTests/MPIUserDefaultsTests.m @@ -11,12 +11,12 @@ @interface MParticle () @property (nonatomic, strong, readonly) MPPersistenceController *persistenceController; @property (nonatomic, strong) MPStateMachine_PRIVATE *stateMachine; -@property (nonatomic, strong) MPKitContainer *kitContainer; +@property (nonatomic, strong) MPKitContainer_PRIVATE *kitContainer; @end @interface MPIUserDefaultsTests : MPBaseTestCase { - MPKitContainer *kitContainer; + MPKitContainer_PRIVATE *kitContainer; } @end @@ -29,12 +29,12 @@ - (void)setUp { [MParticle sharedInstance].stateMachine.apiKey = @"unit_test_app_key"; [MParticle sharedInstance].stateMachine.secret = @"unit_test_secret"; - [MParticle sharedInstance].kitContainer = [[MPKitContainer alloc] init]; + [MParticle sharedInstance].kitContainer = [[MPKitContainer_PRIVATE alloc] init]; kitContainer = [MParticle sharedInstance].kitContainer; } - (void)tearDown { - for (MPKitRegister *kitRegister in [MPKitContainer registeredKits]) { + for (MPKitRegister *kitRegister in [MPKitContainer_PRIVATE registeredKits]) { kitRegister.wrapperInstance = nil; } kitContainer = nil; @@ -471,7 +471,7 @@ - (void)testConfigParameters { XCTAssertNotNil(firstParameters); MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"KitTest" className:@"MPKitTestClassNoStartImmediately"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; XCTAssertEqualObjects(responseConfiguration, [[MPIUserDefaults standardUserDefaults] getConfiguration]); XCTAssertTrue([[MPIUserDefaults standardUserDefaults] isConfigurationParametersOutdated]); diff --git a/UnitTests/MPIdentityTests.m b/UnitTests/MPIdentityTests.m index 653dde73..c7d9cf0a 100644 --- a/UnitTests/MPIdentityTests.m +++ b/UnitTests/MPIdentityTests.m @@ -23,7 +23,7 @@ typedef NS_ENUM(NSUInteger, MPIdentityRequestType) { }; @interface MPIdentityTests : MPBaseTestCase { - MPKitContainer *kitContainer; + MPKitContainer_PRIVATE *kitContainer; } @end @@ -58,7 +58,7 @@ - (instancetype)initWithIdentities:(NSDictionary *)identities; @interface MParticle () -@property (nonatomic, strong) MPKitContainer *kitContainer; +@property (nonatomic, strong) MPKitContainer_PRIVATE *kitContainer; @property (nonatomic, strong, readonly) MPPersistenceController *persistenceController; @end @@ -614,7 +614,7 @@ - (void)testIdentifyIdentityRequestCompleteWithKits { [[[mockPersistenceController stub] andReturn:@"42"] mpId]; id mockInstance = OCMClassMock([MParticle class]); - id mockContainer = OCMClassMock([MPKitContainer class]); + id mockContainer = OCMClassMock([MPKitContainer_PRIVATE class]); [[[mockInstance stub] andReturn:mockContainer] kitContainer]; [[[mockInstance stub] andReturn:mockInstance] sharedInstance]; @@ -646,7 +646,7 @@ - (void)testLoginIdentityRequestCompleteWithKits { [[[mockPersistenceController stub] andReturn:@"42"] mpId]; id mockInstance = OCMClassMock([MParticle class]); - id mockContainer = OCMClassMock([MPKitContainer class]); + id mockContainer = OCMClassMock([MPKitContainer_PRIVATE class]); [[[mockInstance stub] andReturn:mockContainer] kitContainer]; [[[mockInstance stub] andReturn:mockInstance] sharedInstance]; @@ -678,7 +678,7 @@ - (void)testLogoutIdentityRequestCompleteWithKits { [[[mockPersistenceController stub] andReturn:@"42"] mpId]; id mockInstance = OCMClassMock([MParticle class]); - id mockContainer = OCMClassMock([MPKitContainer class]); + id mockContainer = OCMClassMock([MPKitContainer_PRIVATE class]); [[[mockInstance stub] andReturn:mockContainer] kitContainer]; [[[mockInstance stub] andReturn:mockInstance] sharedInstance]; @@ -706,7 +706,7 @@ - (void)testIdentifyIdentityRequestCompleteWithKitsAndNoUserChange { [[[mockPersistenceController stub] andReturn:@"42"] mpId]; id mockInstance = OCMClassMock([MParticle class]); - id mockContainer = OCMClassMock([MPKitContainer class]); + id mockContainer = OCMClassMock([MPKitContainer_PRIVATE class]); [[[mockInstance stub] andReturn:mockContainer] kitContainer]; [[[mockInstance stub] andReturn:mockInstance] sharedInstance]; @@ -738,7 +738,7 @@ - (void)testLoginIdentityRequestCompleteWithKitsAndNoUserChange { [[[mockPersistenceController stub] andReturn:@"42"] mpId]; id mockInstance = OCMClassMock([MParticle class]); - id mockContainer = OCMClassMock([MPKitContainer class]); + id mockContainer = OCMClassMock([MPKitContainer_PRIVATE class]); [[[mockInstance stub] andReturn:mockContainer] kitContainer]; [[[mockInstance stub] andReturn:mockInstance] sharedInstance]; @@ -770,7 +770,7 @@ - (void)testLogoutIdentityRequestCompleteWithKitsAndNoUserChange { [[[mockPersistenceController stub] andReturn:@"42"] mpId]; id mockInstance = OCMClassMock([MParticle class]); - id mockContainer = OCMClassMock([MPKitContainer class]); + id mockContainer = OCMClassMock([MPKitContainer_PRIVATE class]); [[[mockInstance stub] andReturn:mockContainer] kitContainer]; [[[mockInstance stub] andReturn:mockInstance] sharedInstance]; @@ -798,7 +798,7 @@ - (void)testMPIdZeroToMPId { [[[mockPersistenceController stub] andReturn:@"0"] mpId]; id mockInstance = OCMClassMock([MParticle class]); - id mockContainer = OCMClassMock([MPKitContainer class]); + id mockContainer = OCMClassMock([MPKitContainer_PRIVATE class]); [[[mockInstance stub] andReturn:mockContainer] kitContainer]; [[[mockInstance stub] andReturn:mockPersistenceController] persistenceController]; [[[mockInstance stub] andReturn:mockInstance] sharedInstance]; @@ -855,7 +855,7 @@ - (void)testModifyRequestComplete { - (void)testModifyRequestCompleteWithKits { id mockInstance = OCMClassMock([MParticle class]); - id mockContainer = OCMClassMock([MPKitContainer class]); + id mockContainer = OCMClassMock([MPKitContainer_PRIVATE class]); [[[mockInstance stub] andReturn:mockContainer] kitContainer]; [[[mockInstance stub] andReturn:mockInstance] sharedInstance]; diff --git a/UnitTests/MPKitAPITests.m b/UnitTests/MPKitAPITests.m index 67294459..e56073ef 100644 --- a/UnitTests/MPKitAPITests.m +++ b/UnitTests/MPKitAPITests.m @@ -13,7 +13,7 @@ #import "MPIUserDefaults.h" #import "MPIConstants.h" -@interface MPKitContainer () +@interface MPKitContainer_PRIVATE () - (id)startKit:(NSNumber *)integrationId configuration:(MPKitConfiguration *)kitConfiguration; @@ -24,7 +24,7 @@ @interface MParticle () + (dispatch_queue_t)messageQueue; @property (nonatomic, strong) MPBackendController_PRIVATE *backendController; @property (nonatomic, strong) MPPersistenceController *persistenceController; -@property (nonatomic, strong) MPKitContainer *kitContainer; +@property (nonatomic, strong) MPKitContainer_PRIVATE *kitContainer; @end @@ -46,7 +46,7 @@ - (id)initWithKitCode:(NSNumber *)integrationId; @interface MPKitAPITests : MPBaseTestCase @property (nonatomic) MPKitAPI *kitApi; -@property (nonatomic) MPKitContainer *kitContainer; +@property (nonatomic) MPKitContainer_PRIVATE *kitContainer; @end @@ -55,15 +55,15 @@ @implementation MPKitAPITests - (void)setUp { [super setUp]; - [MParticle sharedInstance].kitContainer = [[MPKitContainer alloc] init]; + [MParticle sharedInstance].kitContainer = [[MPKitContainer_PRIVATE alloc] init]; _kitContainer = [MParticle sharedInstance].kitContainer; [MParticle sharedInstance].persistenceController = [[MPPersistenceController alloc] init]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; if (!registeredKits) { MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"KitTest" className:@"MPKitTestClassNoStartImmediately"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; NSDictionary *configuration = @{ @"id":@42, diff --git a/UnitTests/MPKitActivityTests.m b/UnitTests/MPKitActivityTests.m index 6fc54345..733047c6 100644 --- a/UnitTests/MPKitActivityTests.m +++ b/UnitTests/MPKitActivityTests.m @@ -8,17 +8,17 @@ #import "MPStateMachine.h" #import #import "MPBaseTestCase.h" -#import "mParticle.h" +#import "MParticle.h" @interface MParticle () @property (nonatomic, strong) MPStateMachine_PRIVATE *stateMachine; -@property (nonatomic, strong) MPKitContainer *kitContainer; +@property (nonatomic, strong) MPKitContainer_PRIVATE *kitContainer; @end #pragma mark - MPKitContainer category for unit tests -@interface MPKitContainer(Tests) +@interface MPKitContainer_PRIVATE(Tests) - (id)startKit:(NSNumber *)integrationId configuration:(MPKitConfiguration *)kitConfiguration; + (NSMutableSet > *)kitsRegistry; @@ -44,10 +44,10 @@ - (void)setUp { [MParticle sharedInstance].stateMachine.apiKey = @"unit_test_app_key"; [MParticle sharedInstance].stateMachine.secret = @"unit_test_secret"; - [MParticle sharedInstance].kitContainer = [[MPKitContainer alloc] init]; + [MParticle sharedInstance].kitContainer = [[MPKitContainer_PRIVATE alloc] init]; MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"KitTest" className:@"MPKitTestClassNoStartImmediately"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; NSDictionary *configuration = @{@"id": @42, @"as": @{@"appId":@"MyAppId"}}; MPKitConfiguration *kitConfiguration = [[MPKitConfiguration alloc] initWithDictionary:configuration]; [[[MParticle sharedInstance].kitContainer startKit:@42 configuration:kitConfiguration] start]; @@ -57,7 +57,7 @@ - (void)tearDown { _kitActivity = nil; // Ensure registeredKits is empty - [MPKitContainer.kitsRegistry removeAllObjects]; + [MPKitContainer_PRIVATE.kitsRegistry removeAllObjects]; [super tearDown]; } diff --git a/UnitTests/MPKitContainerTests.m b/UnitTests/MPKitContainerTests.m index 2e2dc0d0..8129ad7b 100644 --- a/UnitTests/MPKitContainerTests.m +++ b/UnitTests/MPKitContainerTests.m @@ -35,7 +35,7 @@ @interface MParticle () + (dispatch_queue_t)messageQueue; @property (nonatomic, strong) MPStateMachine_PRIVATE *stateMachine; -@property (nonatomic, strong) MPKitContainer *kitContainer; +@property (nonatomic, strong) MPKitContainer_PRIVATE *kitContainer; @property (nonatomic, strong, readonly) MPBackendController_PRIVATE *backendController; @end @@ -47,7 +47,7 @@ @interface MParticleUser () @end #pragma mark - MPKitContainer category for unit tests -@interface MPKitContainer(Tests) +@interface MPKitContainer_PRIVATE(Tests) @property (nonatomic, strong) NSMutableArray *forwardQueue; @property (nonatomic, unsafe_unretained) BOOL kitsInitialized; @@ -76,7 +76,7 @@ - (void)attemptToLogEventToKit:(id)kitRegister kitFilter #pragma mark - MPKitContainerTests @interface MPKitContainerTests : MPBaseTestCase { - MPKitContainer *kitContainer; + MPKitContainer_PRIVATE *kitContainer; } @end @@ -90,19 +90,19 @@ - (void)setUp { [MParticle sharedInstance].stateMachine.apiKey = @"unit_test_app_key"; [MParticle sharedInstance].stateMachine.secret = @"unit_test_secret"; - [MParticle sharedInstance].kitContainer = [[MPKitContainer alloc] init]; + [MParticle sharedInstance].kitContainer = [[MPKitContainer_PRIVATE alloc] init]; kitContainer = [MParticle sharedInstance].kitContainer; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; if (!registeredKits) { MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"KitTest" className:@"MPKitTestClassNoStartImmediately"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; kitRegister = [[MPKitRegister alloc] initWithName:@"KitSecondTest" className:@"MPKitSecondTestClass"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; kitRegister = [[MPKitRegister alloc] initWithName:@"AppsFlyer" className:@"MPKitAppsFlyerTest"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; NSDictionary *configuration = @{ @"id":@42, @@ -119,12 +119,12 @@ - (void)setUp { id kitAppsFlyer = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; if (!kitAppsFlyer) { MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"AppsFlyer" className:@"MPKitAppsFlyerTest"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; } } - (void)tearDown { - for (MPKitRegister *kitRegister in [MPKitContainer registeredKits]) { + for (MPKitRegister *kitRegister in [MPKitContainer_PRIVATE registeredKits]) { kitRegister.wrapperInstance = nil; } kitContainer = nil; @@ -507,7 +507,7 @@ - (void)testFilterEventType { @"modality":@"sprinting"}; event.category = @"Olympic Games"; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; id registeredKit = [[registeredKits objectsPassingTest:^BOOL(id _Nonnull obj, BOOL * _Nonnull stop) { if ([obj conformsToProtocol:@protocol(MPExtensionKitProtocol)]) { id kitExtension = (id)obj; @@ -802,7 +802,7 @@ - (void)testFilterMessageType { @"modality":@"sprinting"}; event.category = @"Olympic Games"; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; id registeredKit = [[registeredKits objectsPassingTest:^BOOL(id _Nonnull obj, BOOL * _Nonnull stop) { if ([obj conformsToProtocol:@protocol(MPExtensionKitProtocol)]) { id kitExtension = (id)obj; @@ -838,7 +838,7 @@ - (void)testFilterEventTypeNavigation { MPEvent *event = [[MPEvent alloc] initWithName:@"Dinosaur Run" type:MPEventTypeNavigation]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; id registeredKit = [[registeredKits objectsPassingTest:^BOOL(id _Nonnull obj, BOOL * _Nonnull stop) { if ([obj conformsToProtocol:@protocol(MPExtensionKitProtocol)]) { id kitExtension = (id)obj; @@ -883,7 +883,7 @@ - (void)testFilterEventNameAndAttributes { @"modality":@"sprinting"}; event.category = @"Olympic Games"; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; id registeredKit = [[registeredKits objectsPassingTest:^BOOL(id _Nonnull obj, BOOL * _Nonnull stop) { if ([obj conformsToProtocol:@protocol(MPExtensionKitProtocol)]) { id kitExtension = (id)obj; @@ -950,7 +950,7 @@ - (void)testFilterForSelector { [kitContainer configureKits:nil]; [kitContainer configureKits:configurations]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 42"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -975,7 +975,7 @@ - (void)testFilterForUserAttribute { [kitContainer configureKits:nil]; [kitContainer configureKits:configurations]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 42"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -1070,7 +1070,7 @@ - (void)testFilterForUserAttributes { [kitContainer configureKits:nil]; [kitContainer configureKits:configurations]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 42"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -1113,7 +1113,7 @@ - (void)testFilterForUserIdentity { [kitContainer configureKits:nil]; [kitContainer configureKits:configurations]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 42"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -1146,7 +1146,7 @@ - (void)testFilterCommerceEvent_EventType { [kitContainer configureKits:nil]; [kitContainer configureKits:configurations]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; id registeredKit = [registeredKits anyObject]; MPProduct *product = [[MPProduct alloc] initWithName:@"DeLorean" sku:@"OutATime" quantity:@1 price:@4.32]; @@ -1199,7 +1199,7 @@ - (void)testFilterCommerceEvent_EntityType { [kitContainer configureKits:nil]; [kitContainer configureKits:configurations]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; id registeredKit = [registeredKits anyObject]; MPProduct *product = [[MPProduct alloc] initWithName:@"DeLorean" sku:@"OutATime" quantity:@1 price:@4.32]; @@ -1263,7 +1263,7 @@ - (void)testFilterCommerceEvent_Other { [kitContainer configureKits:nil]; [kitContainer configureKits:configurations]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; id registeredKit = [registeredKits anyObject]; MPProduct *product = [[MPProduct alloc] initWithName:@"DeLorean" sku:@"OutATime" quantity:@1 price:@4.32]; @@ -1328,7 +1328,7 @@ - (void)testFilterCommerceEvent_TransactionAttributes { [kitContainer configureKits:nil]; [kitContainer configureKits:configurations]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 42"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -2104,7 +2104,7 @@ - (void)testAttributeHashProjection { } - (void)testAllocation { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; XCTAssertNotNil(localKitContainer); } @@ -2191,7 +2191,7 @@ - (void)testExpandedCommerceEventProjection { } - (void)testShouldDelayUploadMaxTime { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; [localKitContainer setKitsInitialized:NO]; XCTAssertFalse([localKitContainer shouldDelayUpload:0]); XCTAssertTrue([localKitContainer shouldDelayUpload:10000]); @@ -2291,24 +2291,24 @@ - (void)testIsDisabledByConsentKitFilterCCPA { } - (void)testInitializeKitsWhenNilSupportedKits { - MPKitContainer *kitContainer = [[MPKitContainer alloc] init]; - MPKitContainer *mockKitContainer = OCMPartialMock(kitContainer); + MPKitContainer_PRIVATE *kitContainer = [[MPKitContainer_PRIVATE alloc] init]; + MPKitContainer_PRIVATE *mockKitContainer = OCMPartialMock(kitContainer); [[[(id)mockKitContainer stub] andReturn:nil] supportedKits]; [mockKitContainer initializeKits]; XCTAssertTrue(mockKitContainer.kitsInitialized); } - (void)testInitializeKitsWhenEmptySupportedKits { - MPKitContainer *kitContainer = [[MPKitContainer alloc] init]; - MPKitContainer *mockKitContainer = OCMPartialMock(kitContainer); + MPKitContainer_PRIVATE *kitContainer = [[MPKitContainer_PRIVATE alloc] init]; + MPKitContainer_PRIVATE *mockKitContainer = OCMPartialMock(kitContainer); [[[(id)mockKitContainer stub] andReturn: @[] ] supportedKits]; [mockKitContainer initializeKits]; XCTAssertTrue(mockKitContainer.kitsInitialized); } - (void)testInitializeKitsWhenNonemptySupportedKits { - MPKitContainer *kitContainer = [[MPKitContainer alloc] init]; - MPKitContainer *mockKitContainer = OCMPartialMock(kitContainer); + MPKitContainer_PRIVATE *kitContainer = [[MPKitContainer_PRIVATE alloc] init]; + MPKitContainer_PRIVATE *mockKitContainer = OCMPartialMock(kitContainer); [[[(id)mockKitContainer stub] andReturn: @[@123] ] supportedKits]; [mockKitContainer initializeKits]; XCTAssertFalse(mockKitContainer.kitsInitialized); @@ -2318,7 +2318,7 @@ - (void)testInitializeKitsWhenNonemptySupportedKits { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" - (void)testAttemptToLogEventToKit { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; MPEvent *event = [[MPEvent alloc] initWithName:@"test_string" type:MPEventTypeOther]; event.customAttributes = @{@"plan":@"premium"}; @@ -2341,7 +2341,7 @@ - (void)testAttemptToLogEventToKit { #pragma clang diagnostic pop - (void)testAttemptToLogBaseEventToKit { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; MPEvent *event = [[MPEvent alloc] initWithName:@"test_string" type:MPEventTypeOther]; event.customAttributes = @{@"plan":@"premium"}; @@ -2360,7 +2360,7 @@ - (void)testAttemptToLogBaseEventToKit { } - (void)testAttemptToLogBaseEventMediaTypeToKit { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; MPEvent *event = [[MPEvent alloc] initWithName:@"test_string" type:MPEventTypeMedia]; event.customAttributes = @{@"plan":@"premium"}; @@ -2379,7 +2379,7 @@ - (void)testAttemptToLogBaseEventMediaTypeToKit { } - (void)testAttemptToSetOptOutToKitTrue { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"AppsFlyer" className:@"MPKitAppsFlyerTest"]; id kitWrapperMock = OCMProtocolMock(@protocol(MPKitProtocol)); @@ -2398,7 +2398,7 @@ - (void)testAttemptToSetOptOutToKitTrue { } - (void)testAttemptToSetOptOutToKitFalse { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"AppsFlyer" className:@"MPKitAppsFlyerTest"]; id kitWrapperMock = OCMProtocolMock(@protocol(MPKitProtocol)); @@ -2418,7 +2418,7 @@ - (void)testAttemptToSetOptOutToKitFalse { } - (void)testAttemptToLegacyOpenURLToKit { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; SEL selector = @selector(openURL:sourceApplication:annotation:); MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"AppsFlyer" className:@"MPKitAppsFlyerTest"]; @@ -2440,7 +2440,7 @@ - (void)testAttemptToLegacyOpenURLToKit { } - (void)testAttemptToOpenURLToKit { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; SEL selector = @selector(openURL:options:); MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"AppsFlyer" className:@"MPKitAppsFlyerTest"]; @@ -2466,7 +2466,7 @@ - (void)testAttemptToOpenURLToKit { } - (void)testAttemptToContinueUserActivityToKit { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; SEL selector = @selector(continueUserActivity:restorationHandler:); MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"AppsFlyer" className:@"MPKitAppsFlyerTest"]; @@ -2492,7 +2492,7 @@ - (void)testAttemptToContinueUserActivityToKit { } - (void)testAttemptToSurveyToKit { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; MPForwardQueueParameters *queueParameters = [[MPForwardQueueParameters alloc] init]; NSURL *url = [NSURL URLWithString:@"mparticle://baseurl?query"]; @@ -2513,7 +2513,7 @@ - (void)testAttemptToSurveyToKit { } - (void)testAttemptToShouldDelayEventToKit { - MPKitContainer *localKitContainer = [[MPKitContainer alloc] init]; + MPKitContainer_PRIVATE *localKitContainer = [[MPKitContainer_PRIVATE alloc] init]; MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"AppsFlyer" className:@"MPKitAppsFlyerTest"]; id kitWrapperMock = OCMProtocolMock(@protocol(MPKitProtocol)); @@ -2631,7 +2631,7 @@ - (void)testFilterEventTypeForSideloadedKit { @"modality":@"sprinting"}; event.category = @"Olympic Games"; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 1000000000"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -2656,7 +2656,7 @@ - (void)testFilterMessageTypeForSideloadedKit { @"modality":@"sprinting"}; event.category = @"Olympic Games"; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 1000000000"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -2676,7 +2676,7 @@ - (void)testFilterEventTypeNavigationForSideloadedKitForSideloadedKit { MPEvent *event = [[MPEvent alloc] initWithName:@"Dinosaur Run" type:MPEventTypeNavigation]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 1000000000"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -2704,7 +2704,7 @@ - (void)testFilterEventNameForSideloadedKit { @"modality":@"sprinting"}; event.category = @"Olympic Games"; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 1000000000"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -2727,7 +2727,7 @@ - (void)testFilterEventNameAndAttributesForSideloadedKit { @"modality":@"sprinting"}; event.category = @"Olympic Games"; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 1000000000"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -2745,7 +2745,7 @@ - (void)testFilterForSelectorForSideloadedKit { kitContainer.sideloadedKits = @[sideloadedKit1]; [kitContainer initializeKits]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 1000000000"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -2760,7 +2760,7 @@ - (void)testFilterForUserAttributeForSideloadedKit { kitContainer.sideloadedKits = @[sideloadedKit1]; [kitContainer initializeKits]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 1000000000"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -2832,7 +2832,7 @@ - (void)testFilterForUserAttributesForSideloadedKit { @"growl":@"loud", @"teeth":@"sharp"}; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 1000000000"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -2863,7 +2863,7 @@ - (void)testFilterForUserIdentityForSideloadedKit { kitContainer.sideloadedKits = @[sideloadedKit1]; [kitContainer initializeKits]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 1000000000"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; @@ -2886,7 +2886,7 @@ - (void)testFilterCommerceEvent_EventTypeForSideloadedKit { kitContainer.sideloadedKits = @[sideloadedKit1]; [kitContainer initializeKits]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; id registeredKit = [registeredKits anyObject]; MPProduct *product = [[MPProduct alloc] initWithName:@"DeLorean" sku:@"OutATime" quantity:@1 price:@4.32]; @@ -2929,7 +2929,7 @@ - (void)testFilterCommerceEvent_EntityTypeForSideloadedKit { kitContainer.sideloadedKits = @[sideloadedKit1]; [kitContainer initializeKits]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; id registeredKit = [registeredKits anyObject]; MPProduct *product = [[MPProduct alloc] initWithName:@"DeLorean" sku:@"OutATime" quantity:@1 price:@4.32]; @@ -2981,7 +2981,7 @@ - (void)testFilterCommerceEvent_OtherForSideloadedKit { kitContainer.sideloadedKits = @[sideloadedKit1]; [kitContainer initializeKits]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; id registeredKit = [registeredKits anyObject]; MPProduct *product = [[MPProduct alloc] initWithName:@"DeLorean" sku:@"OutATime" quantity:@1 price:@4.32]; @@ -3034,7 +3034,7 @@ - (void)testFilterCommerceEvent_TransactionAttributesForSideloadedKit { kitContainer.sideloadedKits = @[sideloadedKit1]; [kitContainer initializeKits]; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"code == 1000000000"]; id registeredKit = [[registeredKits filteredSetUsingPredicate:predicate] anyObject]; diff --git a/UnitTests/MPStateMachineTests.m b/UnitTests/MPStateMachineTests.m index cd41ee41..75b5377a 100644 --- a/UnitTests/MPStateMachineTests.m +++ b/UnitTests/MPStateMachineTests.m @@ -25,7 +25,7 @@ - (void)resetTriggers; @interface MParticle () @property (nonatomic, strong) MPStateMachine_PRIVATE *stateMachine; -@property (nonatomic, strong) MPKitContainer * kitContainer; +@property (nonatomic, strong) MPKitContainer_PRIVATE * kitContainer; @end @@ -196,11 +196,11 @@ - (void)testEnvironment { - (void)testSetLocation { #if TARGET_OS_IOS == 1 #ifndef MPARTICLE_LOCATION_DISABLE - id mockKitContainer = OCMClassMock([MPKitContainer class]); + id mockKitContainer = OCMClassMock([MPKitContainer_PRIVATE class]); [MParticle sharedInstance].kitContainer = mockKitContainer; XCTestExpectation *expectation = [self expectationWithDescription:@"Set Location"]; - MPKitContainer *kitContainer = [MParticle sharedInstance].kitContainer; + MPKitContainer_PRIVATE *kitContainer = [MParticle sharedInstance].kitContainer; [MParticle sharedInstance].location = [[CLLocation alloc] init]; diff --git a/UnitTests/MPURLRequestBuilderTests.m b/UnitTests/MPURLRequestBuilderTests.m index 7cc00407..0d58994c 100644 --- a/UnitTests/MPURLRequestBuilderTests.m +++ b/UnitTests/MPURLRequestBuilderTests.m @@ -24,7 +24,7 @@ @interface MParticle () + (dispatch_queue_t)messageQueue; @property (nonatomic, strong) MPStateMachine_PRIVATE *stateMachine; -@property (nonatomic, strong) MPKitContainer *kitContainer; +@property (nonatomic, strong) MPKitContainer_PRIVATE *kitContainer; @property (nonatomic, strong) MParticleWebView *webView; @end @@ -42,7 +42,7 @@ - (NSString *)signatureRelativePath:(NSString *)relativePath url:(NSURL *)url; @end #pragma mark - MPKitContainer category for unit tests -@interface MPKitContainer(Tests) +@interface MPKitContainer_PRIVATE(Tests) - (id)startKit:(NSNumber *)integrationId configuration:(MPKitConfiguration *)kitConfiguration; @@ -50,7 +50,7 @@ @interface MPKitContainer(Tests) #pragma mark - MPURLRequestBuilderTests @interface MPURLRequestBuilderTests : MPBaseTestCase { - MPKitContainer *kitContainer; + MPKitContainer_PRIVATE *kitContainer; } @end @@ -65,19 +65,19 @@ - (void)setUp { [MParticle sharedInstance].stateMachine.apiKey = @"unit_test_app_key"; [MParticle sharedInstance].stateMachine.secret = @"unit_test_secret"; - [MParticle sharedInstance].kitContainer = [[MPKitContainer alloc] init]; + [MParticle sharedInstance].kitContainer = [[MPKitContainer_PRIVATE alloc] init]; kitContainer = [MParticle sharedInstance].kitContainer; - NSSet> *registeredKits = [MPKitContainer registeredKits]; + NSSet> *registeredKits = [MPKitContainer_PRIVATE registeredKits]; if (!registeredKits) { MPKitRegister *kitRegister = [[MPKitRegister alloc] initWithName:@"KitTest" className:@"MPKitTestClassNoStartImmediately"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; kitRegister = [[MPKitRegister alloc] initWithName:@"KitSecondTest" className:@"MPKitSecondTestClass"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; kitRegister = [[MPKitRegister alloc] initWithName:@"AppsFlyer" className:@"MPKitAppsFlyerTest"]; - [MPKitContainer registerKit:kitRegister]; + [MPKitContainer_PRIVATE registerKit:kitRegister]; NSDictionary *configuration = @{ @"id":@42, @@ -376,7 +376,7 @@ - (void)testEventRequest { id mockWebView = OCMPartialMock(webview); [[[mockWebView stub] andReturn:agent] userAgent]; - id mockKitContainer = OCMClassMock([MPKitContainer class]); + id mockKitContainer = OCMClassMock([MPKitContainer_PRIVATE class]); NSNumber *mockKitId = @42; [[[mockKitContainer stub] andReturn:@[mockKitId]] configuredKitsRegistry]; diff --git a/UnitTests/MParticleTests.m b/UnitTests/MParticleTests.m index 3fd4f385..fc03c051 100644 --- a/UnitTests/MParticleTests.m +++ b/UnitTests/MParticleTests.m @@ -34,7 +34,7 @@ - (void)setIdentitySync:(NSString *)identityString identityType:(MPIdentity)iden - (void)setUserId:(NSNumber *)userId; @end -@interface MPKitContainer () +@interface MPKitContainer_PRIVATE () @property (nonatomic, strong) NSMutableDictionary *kitConfigurations; + (NSMutableSet > *)kitsRegistry; @end @@ -54,7 +54,7 @@ - (void)setUp { lastNotification = nil; // Ensure registeredKits is empty - [MPKitContainer.kitsRegistry removeAllObjects]; + [MPKitContainer_PRIVATE.kitsRegistry removeAllObjects]; } - (void)tearDown { @@ -1147,8 +1147,8 @@ - (void)testSwitchWorkspaceSideloadedKits { [[MParticle sharedInstance] startWithOptions:options1]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, WORKSPACE_SWITCHING_DELAY), dispatch_get_main_queue(), ^{ - XCTAssertEqual(MPKitContainer.registeredKits.count, 1); - XCTAssertEqualObjects(MPKitContainer.registeredKits.anyObject.wrapperInstance, kitTestSideloaded1); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 1); + XCTAssertEqualObjects(MPKitContainer_PRIVATE.registeredKits.anyObject.wrapperInstance, kitTestSideloaded1); // Switch workspace with a new sideloaded kit MParticleOptions *options2 = [MParticleOptions optionsWithKey:@"unit-test-key" secret:@"unit-test-secret"]; @@ -1158,15 +1158,15 @@ - (void)testSwitchWorkspaceSideloadedKits { [[MParticle sharedInstance] switchWorkspaceWithOptions:options2]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, WORKSPACE_SWITCHING_DELAY), dispatch_get_main_queue(), ^{ - XCTAssertEqual(MPKitContainer.registeredKits.count, 1); - XCTAssertEqualObjects(MPKitContainer.registeredKits.anyObject.wrapperInstance, kitTestSideloaded2); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 1); + XCTAssertEqualObjects(MPKitContainer_PRIVATE.registeredKits.anyObject.wrapperInstance, kitTestSideloaded2); // Switch workspace with no sideloaded kits MParticleOptions *options3 = [MParticleOptions optionsWithKey:@"unit-test-key" secret:@"unit-test-secret"]; [[MParticle sharedInstance] switchWorkspaceWithOptions:options3]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, WORKSPACE_SWITCHING_DELAY), dispatch_get_main_queue(), ^{ - XCTAssertEqual(MPKitContainer.registeredKits.count, 0); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 0); [expectation fulfill]; }); @@ -1180,20 +1180,20 @@ - (void)testSwitchWorkspaceSideloadedKits { - (void)testSwitchWorkspaceKitsNoConfigurations { XCTestExpectation *expectation = [self expectationWithDescription:@"async work"]; - XCTAssertEqual(MPKitContainer.registeredKits.count, 0); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 0); [MParticle registerExtension:[[MPKitRegister alloc] initWithName:@"TestKitNoStop" className:@"MPKitTestClassNoStartImmediately"]]; [MParticle registerExtension:[[MPKitRegister alloc] initWithName:@"TestKitWithStop" className:@"MPKitTestClassNoStartImmediatelyWithStop"]]; - XCTAssertEqual(MPKitContainer.registeredKits.count, 2); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 2); MParticleOptions *options = [MParticleOptions optionsWithKey:@"unit-test-key" secret:@"unit-test-secret"]; [[MParticle sharedInstance] startWithOptions:options]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, WORKSPACE_SWITCHING_DELAY), dispatch_get_main_queue(), ^{ - XCTAssertEqual(MPKitContainer.registeredKits.count, 2); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 2); [[MParticle sharedInstance] switchWorkspaceWithOptions:options]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, WORKSPACE_SWITCHING_DELAY), dispatch_get_main_queue(), ^{ - XCTAssertEqual(MPKitContainer.registeredKits.count, 2); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 2); [expectation fulfill]; }); }); @@ -1205,7 +1205,7 @@ - (void)testSwitchWorkspaceKitsNoConfigurations { - (void)testSwitchWorkspaceKitsWithoutStop { XCTestExpectation *expectation = [self expectationWithDescription:@"async work"]; - XCTAssertEqual(MPKitContainer.registeredKits.count, 0); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 0); MPKitRegister *registerNoStop = [[MPKitRegister alloc] initWithName:@"TestKitNoStop" className:@"MPKitTestClassNoStartImmediately"]; [MParticle registerExtension:registerNoStop]; @@ -1216,12 +1216,12 @@ - (void)testSwitchWorkspaceKitsWithoutStop { registerNoStop.wrapperInstance = [[MPKitTestClassNoStartImmediately alloc] init]; [MParticle sharedInstance].kitContainer.kitConfigurations[@42] = [[MPKitConfiguration alloc] init]; - XCTAssertEqual(MPKitContainer.registeredKits.count, 1); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 1); [[MParticle sharedInstance] switchWorkspaceWithOptions:options]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, WORKSPACE_SWITCHING_DELAY), dispatch_get_main_queue(), ^{ - XCTAssertEqual(MPKitContainer.registeredKits.count, 0); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 0); [expectation fulfill]; }); }); @@ -1233,7 +1233,7 @@ - (void)testSwitchWorkspaceKitsWithoutStop { - (void)testSwitchWorkspaceKitsWithStop { XCTestExpectation *expectation = [self expectationWithDescription:@"async work"]; - XCTAssertEqual(MPKitContainer.registeredKits.count, 0); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 0); MPKitRegister *registerWithStop = [[MPKitRegister alloc] initWithName:@"TestKitWithStop" className:@"MPKitTestClassNoStartImmediatelyWithStop"]; [MParticle registerExtension:registerWithStop]; @@ -1244,12 +1244,12 @@ - (void)testSwitchWorkspaceKitsWithStop { registerWithStop.wrapperInstance = [[MPKitTestClassNoStartImmediatelyWithStop alloc] init]; [MParticle sharedInstance].kitContainer.kitConfigurations[@43] = [[MPKitConfiguration alloc] init]; - XCTAssertEqual(MPKitContainer.registeredKits.count, 1); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 1); [[MParticle sharedInstance] switchWorkspaceWithOptions:options]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, WORKSPACE_SWITCHING_DELAY), dispatch_get_main_queue(), ^{ - XCTAssertEqual(MPKitContainer.registeredKits.count, 1); + XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 1); [expectation fulfill]; }); }); diff --git a/mParticle-Apple-SDK.xcodeproj/project.pbxproj b/mParticle-Apple-SDK.xcodeproj/project.pbxproj index fa0ae7bb..5089f332 100644 --- a/mParticle-Apple-SDK.xcodeproj/project.pbxproj +++ b/mParticle-Apple-SDK.xcodeproj/project.pbxproj @@ -854,11 +854,11 @@ children = ( 53A79C2229CDFB4800E7489F /* Include */, 53A79B3629CDFB1F00E7489F /* mParticle.m */, - 53A79AA329CDFB1E00E7489F /* MPBackendController.h */, 53A79AF429CDFB1F00E7489F /* MPBackendController.m */, 53A79AD029CDFB1F00E7489F /* MPEnums.m */, 53A79ACF29CDFB1F00E7489F /* MPIConstants.h */, 53A79B6429CDFB1F00E7489F /* MPIConstants.m */, + 53A79B0329CDFB1F00E7489F /* MPStateMachine.m */, 530D24812CFF72D4000FE7E3 /* MPConstants.swift */, 534CD25D29CE2BF1008452B3 /* MParticleSwift.h */, 53A79B3729CDFB1F00E7489F /* AppNotifications */, @@ -1006,10 +1006,8 @@ 5399DDB72CA727E1006526E1 /* MPZip.swift */, 53A79B0229CDFB1F00E7489F /* MPMessageBuilder.m */, D3961CD52CB468DC003B3194 /* NSArray+MPCaseInsensitive.swift */, - 53A79B0329CDFB1F00E7489F /* MPStateMachine.m */, 53A79B0429CDFB1F00E7489F /* MPIUserDefaults.h */, D3CEDACA2CB027E1001B32DF /* MPConvertJS.swift */, - 53A79B0629CDFB1F00E7489F /* MPStateMachine.h */, 53A79B0929CDFB1F00E7489F /* NSDictionary+MPCaseInsensitive.m */, D356E0232CFE08ED0020898D /* MPResponseConfig.swift */, D3CEDAC22C9DAC25001B32DF /* MPDateFormatter.swift */, @@ -1024,7 +1022,6 @@ 53A79B1D29CDFB1F00E7489F /* MPIUserDefaults.m */, 53A79B1E29CDFB1F00E7489F /* MPBracket.cpp */, 53A79B2329CDFB1F00E7489F /* MPUploadBuilder.h */, - 53A79B2429CDFB1F00E7489F /* MPApplication.h */, 53A79B2629CDFB1F00E7489F /* NSNumber+MPFormatter.swift */, 53A79B2729CDFB1F00E7489F /* MPUserAttributeChange.m */, 53A79B2929CDFB1F00E7489F /* MPLaunchInfo.m */, @@ -1119,7 +1116,6 @@ 53A79B5829CDFB1F00E7489F /* MPEventProjection.mm */, 53A79B5929CDFB1F00E7489F /* MPForwardQueueParameters.h */, 53A79B5A29CDFB1F00E7489F /* MPAttributeProjection.m */, - 53A79B5B29CDFB1F00E7489F /* MPKitContainer.h */, 53A79B5C29CDFB1F00E7489F /* MPKitAPI.m */, 53A79B5D29CDFB1F00E7489F /* MPForwardQueueItem.m */, 53A79B5E29CDFB1F00E7489F /* MPKitActivity.h */, @@ -1172,7 +1168,11 @@ 53A79C4129CDFB4800E7489F /* MPKitRegister.h */, 53A79C4229CDFB4800E7489F /* MPProduct+Dictionary.h */, 53A79C4329CDFB4800E7489F /* MPProduct.h */, + 53A79B0629CDFB1F00E7489F /* MPStateMachine.h */, 53A79C4429CDFB4800E7489F /* MPTransactionAttributes+Dictionary.h */, + 53A79B5B29CDFB1F00E7489F /* MPKitContainer.h */, + 53A79B2429CDFB1F00E7489F /* MPApplication.h */, + 53A79AA329CDFB1E00E7489F /* MPBackendController.h */, ); path = Include; sourceTree = ""; diff --git a/mParticle-Apple-SDK/AppNotifications/MPAppNotificationHandler.m b/mParticle-Apple-SDK/AppNotifications/MPAppNotificationHandler.m index f33111e2..81ed8263 100644 --- a/mParticle-Apple-SDK/AppNotifications/MPAppNotificationHandler.m +++ b/mParticle-Apple-SDK/AppNotifications/MPAppNotificationHandler.m @@ -1,5 +1,4 @@ #import "MPAppNotificationHandler.h" -#import "MPStateMachine.h" #import "MPLaunchInfo.h" #import "MPForwardRecord.h" #import "MPPersistenceController.h" @@ -299,7 +298,7 @@ - (BOOL)continueUserActivity:(nonnull NSUserActivity *)userActivity restorationH ]; }); - NSSet> *registeredKitsRegistry = [MPKitContainer registeredKits]; + NSSet> *registeredKitsRegistry = [MPKitContainer_PRIVATE registeredKits]; BOOL handlingActivity = NO; for (id kitRegister in registeredKitsRegistry) { if ([kitRegister.wrapperInstance respondsToSelector:continueUserActivitySelector]) { diff --git a/mParticle-Apple-SDK/AppNotifications/MPSurrogateAppDelegate.m b/mParticle-Apple-SDK/AppNotifications/MPSurrogateAppDelegate.m index ac712e32..883d6292 100644 --- a/mParticle-Apple-SDK/AppNotifications/MPSurrogateAppDelegate.m +++ b/mParticle-Apple-SDK/AppNotifications/MPSurrogateAppDelegate.m @@ -2,7 +2,6 @@ #import "MPAppDelegateProxy.h" #import "MPNotificationController.h" #import "MPAppNotificationHandler.h" -#import "MPStateMachine.h" #import "mParticle.h" @interface MParticle () diff --git a/mParticle-Apple-SDK/Data Model/MPIntegrationAttributes.m b/mParticle-Apple-SDK/Data Model/MPIntegrationAttributes.m index 06cc9760..260b6ce2 100644 --- a/mParticle-Apple-SDK/Data Model/MPIntegrationAttributes.m +++ b/mParticle-Apple-SDK/Data Model/MPIntegrationAttributes.m @@ -1,7 +1,6 @@ #import "MPIntegrationAttributes.h" #import "MPILogger.h" #import "mParticle.h" -#import "MPStateMachine.h" #import "MPIConstants.h" @implementation MPIntegrationAttributes diff --git a/mParticle-Apple-SDK/Data Model/MPUpload.m b/mParticle-Apple-SDK/Data Model/MPUpload.m index 9f2b3768..240b4c7a 100644 --- a/mParticle-Apple-SDK/Data Model/MPUpload.m +++ b/mParticle-Apple-SDK/Data Model/MPUpload.m @@ -2,7 +2,6 @@ #import "MPSession.h" #import "MPIConstants.h" #import "mParticle.h" -#import "MPStateMachine.h" @interface MParticle() @property (nonatomic, strong) MPStateMachine_PRIVATE *stateMachine; diff --git a/mParticle-Apple-SDK/Event/MPBaseEvent.m b/mParticle-Apple-SDK/Event/MPBaseEvent.m index 694592b9..a61c06f2 100644 --- a/mParticle-Apple-SDK/Event/MPBaseEvent.m +++ b/mParticle-Apple-SDK/Event/MPBaseEvent.m @@ -1,6 +1,5 @@ #import "MPBaseEvent.h" #import "MPIConstants.h" -#import "MPStateMachine.h" #import "MPSession.h" #import "mParticle.h" #import "MPILogger.h" diff --git a/mParticle-Apple-SDK/Event/MPEvent.m b/mParticle-Apple-SDK/Event/MPEvent.m index 242790bd..7c56885c 100644 --- a/mParticle-Apple-SDK/Event/MPEvent.m +++ b/mParticle-Apple-SDK/Event/MPEvent.m @@ -1,6 +1,5 @@ #import "MPEvent.h" #import "MPIConstants.h" -#import "MPStateMachine.h" #import "MPSession.h" #import "MPILogger.h" #import "MPProduct.h" diff --git a/mParticle-Apple-SDK/Identity/MPIdentityApi.m b/mParticle-Apple-SDK/Identity/MPIdentityApi.m index 8bcb212a..b02e500c 100644 --- a/mParticle-Apple-SDK/Identity/MPIdentityApi.m +++ b/mParticle-Apple-SDK/Identity/MPIdentityApi.m @@ -16,7 +16,6 @@ #import "MPKitContainer.h" #import "MPDevice.h" #import "MPUpload.h" -#import "MPStateMachine.h" typedef NS_ENUM(NSUInteger, MPIdentityRequestType) { MPIdentityRequestIdentify = 0, @@ -61,7 +60,7 @@ - (void)setUserId:(NSNumber *)userId; - (void)setIsLoggedIn:(BOOL)isLoggedIn; @end -@interface MPKitContainer () +@interface MPKitContainer_PRIVATE () @property (nonatomic, strong) NSMutableDictionary *kitConfigurations; diff --git a/mParticle-Apple-SDK/Identity/MPIdentityDTO.m b/mParticle-Apple-SDK/Identity/MPIdentityDTO.m index d8dbf4dd..2978b3c1 100644 --- a/mParticle-Apple-SDK/Identity/MPIdentityDTO.m +++ b/mParticle-Apple-SDK/Identity/MPIdentityDTO.m @@ -7,7 +7,6 @@ #import "MPDevice.h" #import "MPNotificationController.h" #import "MPPersistenceController.h" -#import "MPStateMachine.h" #import "MPConsumerInfo.h" #import "MPIUserDefaults.h" diff --git a/mParticle-Apple-SDK/Identity/MParticleUser.m b/mParticle-Apple-SDK/Identity/MParticleUser.m index 7395d0fe..27b37e8b 100644 --- a/mParticle-Apple-SDK/Identity/MParticleUser.m +++ b/mParticle-Apple-SDK/Identity/MParticleUser.m @@ -9,6 +9,7 @@ #import "MPIUserDefaults.h" #import "MPDataPlanFilter.h" #import "MPIConstants.h" +#import "MPKitContainer.h" @interface MParticleUser () @@ -26,7 +27,7 @@ + (dispatch_queue_t)messageQueue; @end -@interface MPKitContainer () +@interface MPKitContainer_PRIVATE () @property (nonatomic, strong) NSMutableDictionary *kitConfigurations; diff --git a/mParticle-Apple-SDK/Utils/MPApplication.h b/mParticle-Apple-SDK/Include/MPApplication.h similarity index 100% rename from mParticle-Apple-SDK/Utils/MPApplication.h rename to mParticle-Apple-SDK/Include/MPApplication.h diff --git a/mParticle-Apple-SDK/MPBackendController.h b/mParticle-Apple-SDK/Include/MPBackendController.h similarity index 99% rename from mParticle-Apple-SDK/MPBackendController.h rename to mParticle-Apple-SDK/Include/MPBackendController.h index cc056a40..9f7a9844 100644 --- a/mParticle-Apple-SDK/MPBackendController.h +++ b/mParticle-Apple-SDK/Include/MPBackendController.h @@ -1,8 +1,6 @@ #import "MPEnums.h" -#import "MPNetworkCommunication.h" #if TARGET_OS_IOS == 1 - #import "MPNotificationController.h" #ifndef MPARTICLE_LOCATION_DISABLE #import #endif @@ -21,6 +19,8 @@ @class MParticleSession; @class MPUploadSettings; @class MPNetworkOptions; +@class MPNetworkCommunication; + @protocol MPBackendControllerDelegate; diff --git a/mParticle-Apple-SDK/Kits/MPKitContainer.h b/mParticle-Apple-SDK/Include/MPKitContainer.h similarity index 98% rename from mParticle-Apple-SDK/Kits/MPKitContainer.h rename to mParticle-Apple-SDK/Include/MPKitContainer.h index 570c3cc2..fad6223d 100644 --- a/mParticle-Apple-SDK/Kits/MPKitContainer.h +++ b/mParticle-Apple-SDK/Include/MPKitContainer.h @@ -11,7 +11,7 @@ @class MPAttributionResult; @class MPSideloadedKit; -@interface MPKitContainer : NSObject +@interface MPKitContainer_PRIVATE : NSObject @property (nonatomic, copy) void (^ _Nonnull attributionCompletionHandler)(MPAttributionResult *_Nullable attributionResult, NSError * _Nullable error); @property (nonatomic, strong, nonnull) NSMutableDictionary *attributionInfo; diff --git a/mParticle-Apple-SDK/Utils/MPStateMachine.h b/mParticle-Apple-SDK/Include/MPStateMachine.h similarity index 100% rename from mParticle-Apple-SDK/Utils/MPStateMachine.h rename to mParticle-Apple-SDK/Include/MPStateMachine.h diff --git a/mParticle-Apple-SDK/Include/mParticle.h b/mParticle-Apple-SDK/Include/mParticle.h index dfa29306..31ecc004 100644 --- a/mParticle-Apple-SDK/Include/mParticle.h +++ b/mParticle-Apple-SDK/Include/mParticle.h @@ -644,7 +644,7 @@ Defaults to false. Prevents the eventsHost above from overwriting the alias endp /** The instance which manages all initialized kits. For internal use only */ -@property (nonatomic, strong, readonly) MPKitContainer *kitContainer; +@property (nonatomic, strong, readonly) MPKitContainer_PRIVATE *kitContainer; /** The Kit Configuration needed should the initialization of kits need to be deferred until identity or consent is resolve. For internal use only diff --git a/mParticle-Apple-SDK/Kits/MPKitAPI.m b/mParticle-Apple-SDK/Kits/MPKitAPI.m index 02eef718..871b840e 100644 --- a/mParticle-Apple-SDK/Kits/MPKitAPI.m +++ b/mParticle-Apple-SDK/Kits/MPKitAPI.m @@ -19,7 +19,7 @@ @interface MPAttributionResult () @end -@interface MPKitContainer () +@interface MPKitContainer_PRIVATE () @property (nonatomic, strong, readonly) NSMutableDictionary *kitConfigurations; @@ -35,7 +35,7 @@ @implementation MPKitAPI - (NSString *)kitName { __block NSString *component = nil; - NSSet> *kits = [MPKitContainer registeredKits]; + NSSet> *kits = [MPKitContainer_PRIVATE registeredKits]; NSNumber *kitCode = _kitCode; if (kits && kitCode) { diff --git a/mParticle-Apple-SDK/Kits/MPKitConfiguration.mm b/mParticle-Apple-SDK/Kits/MPKitConfiguration.mm index 292a101c..a3050d97 100644 --- a/mParticle-Apple-SDK/Kits/MPKitConfiguration.mm +++ b/mParticle-Apple-SDK/Kits/MPKitConfiguration.mm @@ -1,7 +1,6 @@ #import "MPKitConfiguration.h" #import "MPIConstants.h" #import "MPEventProjection.h" -#import "MPStateMachine.h" #import "MPILogger.h" #import "MPConsentSerialization.h" #import "mParticle.h" diff --git a/mParticle-Apple-SDK/Kits/MPKitContainer.mm b/mParticle-Apple-SDK/Kits/MPKitContainer.mm index 9795a7e4..af2ba689 100644 --- a/mParticle-Apple-SDK/Kits/MPKitContainer.mm +++ b/mParticle-Apple-SDK/Kits/MPKitContainer.mm @@ -2,7 +2,6 @@ #import "MParticleSwift.h" #import "MPKitExecStatus.h" #import "MPEnums.h" -#import "MPStateMachine.h" #import "MPKitConfiguration.h" #import #import "MPForwardRecord.h" @@ -69,7 +68,7 @@ - (nullable instancetype)initWithInstance:(nonnull NSObject *)ins static const NSInteger sideloadedKitCodeStartValue = 1000000000; -@interface MPKitContainer () { +@interface MPKitContainer_PRIVATE () { dispatch_semaphore_t kitsSemaphore; std::map> brackets; NSInteger sideloadedKitCodeNextValue; @@ -81,12 +80,12 @@ @interface MPKitContainer () { @end -@implementation MPKitContainer +@implementation MPKitContainer_PRIVATE @synthesize kitsInitialized = _kitsInitialized; + (void)initialize { - if (self == [MPKitContainer class]) { + if (self == [MPKitContainer_PRIVATE class]) { kitsRegistry = [[NSMutableSet alloc] initWithCapacity:DEFAULT_ALLOCATION_FOR_KITS]; } } @@ -1106,9 +1105,9 @@ - (void)project:(id)kitRegister commerceEvent:(MPCommerc return; } - __weak MPKitContainer *weakSelf = self; + __weak MPKitContainer_PRIVATE *weakSelf = self; - __strong MPKitContainer *strongSelf = weakSelf; + __strong MPKitContainer_PRIVATE *strongSelf = weakSelf; if (strongSelf) { dispatch_semaphore_wait(strongSelf->kitsSemaphore, DISPATCH_TIME_FOREVER); } @@ -1606,9 +1605,9 @@ - (void)project:(id)kitRegister event:(MPEvent *const)ev return; } - __weak MPKitContainer *weakSelf = self; + __weak MPKitContainer_PRIVATE *weakSelf = self; - __strong MPKitContainer *strongSelf = weakSelf; + __strong MPKitContainer_PRIVATE *strongSelf = weakSelf; if (strongSelf) { dispatch_semaphore_wait(strongSelf->kitsSemaphore, DISPATCH_TIME_FOREVER); } diff --git a/mParticle-Apple-SDK/MPBackendController.m b/mParticle-Apple-SDK/MPBackendController.m index b7b9600f..a08f0ac4 100644 --- a/mParticle-Apple-SDK/MPBackendController.m +++ b/mParticle-Apple-SDK/MPBackendController.m @@ -29,6 +29,10 @@ #import "MPIdentityCaching.h" #import "MParticleSwift.h" #import "MPLaunchInfo.h" +#import "MPNetworkCommunication.h" +#if TARGET_OS_IOS == 1 + #import "MPNotificationController.h" +#endif const NSInteger kNilAttributeValue = 101; const NSInteger kExceededAttributeValueMaximumLength = 104; @@ -50,7 +54,7 @@ @interface MParticle () @property (nonatomic, strong) MPPersistenceController *persistenceController; @property (nonatomic, strong) MPStateMachine_PRIVATE *stateMachine; -@property (nonatomic, strong) MPKitContainer *kitContainer; +@property (nonatomic, strong) MPKitContainer_PRIVATE *kitContainer; @property (nonatomic, strong) MParticleWebView *webView; @property (nonatomic, strong, nullable) NSString *dataPlanId; @property (nonatomic, strong, nullable) NSNumber *dataPlanVersion; @@ -1627,7 +1631,7 @@ - (MPExecStatus)checkForKitsAndUploadWithCompletionHandler:(void (^ _Nullable)(B return; } - MPKitContainer *kitContainer = [MParticle sharedInstance].kitContainer; + MPKitContainer_PRIVATE *kitContainer = [MParticle sharedInstance].kitContainer; BOOL shouldDelayUploadForKits = kitContainer && [kitContainer shouldDelayUpload:kMPMaximumKitWaitTimeSeconds]; BOOL shouldDelayUpload = shouldDelayUploadForKits || [MParticle.sharedInstance.webView shouldDelayUpload:kMPMaximumAgentWaitTimeSeconds]; if (shouldDelayUpload) { diff --git a/mParticle-Apple-SDK/Utils/MPStateMachine.m b/mParticle-Apple-SDK/MPStateMachine.m similarity index 100% rename from mParticle-Apple-SDK/Utils/MPStateMachine.m rename to mParticle-Apple-SDK/MPStateMachine.m diff --git a/mParticle-Apple-SDK/Network/MPNetworkCommunication.m b/mParticle-Apple-SDK/Network/MPNetworkCommunication.m index b03a61ea..b387ffef 100644 --- a/mParticle-Apple-SDK/Network/MPNetworkCommunication.m +++ b/mParticle-Apple-SDK/Network/MPNetworkCommunication.m @@ -3,7 +3,6 @@ #import "MPSession.h" #import #import "MPConnector.h" -#import "MPStateMachine.h" #import "MPUpload.h" #import "MPDevice.h" #import "MPApplication.h" @@ -25,6 +24,7 @@ #import "MPConnectorFactoryProtocol.h" #import "MPIdentityCaching.h" #import "MParticleSwift.h" +#import "MPNetworkCommunication.h" NSString *const urlFormat = @"%@://%@/%@/%@%@"; // Scheme, URL Host, API Version, API key, path NSString *const urlFormatOverride = @"%@://%@/%@%@"; // Scheme, URL Host, API key, path diff --git a/mParticle-Apple-SDK/Network/MPURLRequestBuilder.m b/mParticle-Apple-SDK/Network/MPURLRequestBuilder.m index 47ea0f1b..29064c99 100644 --- a/mParticle-Apple-SDK/Network/MPURLRequestBuilder.m +++ b/mParticle-Apple-SDK/Network/MPURLRequestBuilder.m @@ -152,7 +152,7 @@ - (NSMutableURLRequest *)build { if (_SDKURLRequest || isIdentityRequest) { NSString *deviceLocale = [[NSLocale autoupdatingCurrentLocale] localeIdentifier]; - MPKitContainer *kitContainer = !isIdentityRequest ? [MParticle sharedInstance].kitContainer : nil; + MPKitContainer_PRIVATE *kitContainer = !isIdentityRequest ? [MParticle sharedInstance].kitContainer : nil; NSArray *supportedKits = [kitContainer supportedKits]; NSString *contentType = nil; NSString *kits = nil; diff --git a/mParticle-Apple-SDK/Notifications/MPNotificationController.m b/mParticle-Apple-SDK/Notifications/MPNotificationController.m index 2febd431..5f7e937c 100644 --- a/mParticle-Apple-SDK/Notifications/MPNotificationController.m +++ b/mParticle-Apple-SDK/Notifications/MPNotificationController.m @@ -3,9 +3,7 @@ #import "MPPersistenceController.h" #import "MPIUserDefaults.h" #import "mParticle.h" -#import "MPBackendController.h" -#import "MPApplication.h" -#import "MPStateMachine.h" +#import "MPNetworkCommunication.h" @interface MPNotificationController() { } diff --git a/mParticle-Apple-SDK/mParticle.m b/mParticle-Apple-SDK/mParticle.m index 880a18af..9c420330 100644 --- a/mParticle-Apple-SDK/mParticle.m +++ b/mParticle-Apple-SDK/mParticle.m @@ -13,7 +13,6 @@ #import "MPNotificationController.h" #import "MPPersistenceController.h" #import "MPSession.h" -#import "MPStateMachine.h" #import "MPIUserDefaults.h" #import "MPIdentityApi.h" #import "MParticleWebView.h" @@ -42,7 +41,7 @@ @interface MPIdentityApi () - (void)identifyNoDispatch:(MPIdentityApiRequest *)identifyRequest completion:(nullable MPIdentityApiResultCallback)completion; @end -@interface MPKitContainer () +@interface MPKitContainer_PRIVATE () - (BOOL)kitsInitialized; @end @@ -57,7 +56,7 @@ @interface MParticle() )extension { BOOL registrationSuccessful = NO; if ([extension conformsToProtocol:@protocol(MPExtensionKitProtocol)]) { - registrationSuccessful = [MPKitContainer registerKit:(id)extension]; + registrationSuccessful = [MPKitContainer_PRIVATE registerKit:(id)extension]; } return registrationSuccessful;