Skip to content

Commit

Permalink
address CR
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonStalnaker committed Dec 10, 2024
1 parent f77568f commit 621088d
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 54 deletions.
4 changes: 2 additions & 2 deletions UnitTests/MParticleTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ - (void)testSwitchWorkspaceKitsWithoutStop {

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, WORKSPACE_SWITCHING_DELAY), dispatch_get_main_queue(), ^{
registerNoStop.wrapperInstance = [[MPKitTestClassNoStartImmediately alloc] init];
[MParticle sharedInstance].kitContainer.kitConfigurations[@42] = [[MPKitConfiguration alloc] init];
[MParticle sharedInstance].kitContainer_PRIVATE.kitConfigurations[@42] = [[MPKitConfiguration alloc] init];

XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 1);

Expand Down Expand Up @@ -1242,7 +1242,7 @@ - (void)testSwitchWorkspaceKitsWithStop {

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, WORKSPACE_SWITCHING_DELAY), dispatch_get_main_queue(), ^{
registerWithStop.wrapperInstance = [[MPKitTestClassNoStartImmediatelyWithStop alloc] init];
[MParticle sharedInstance].kitContainer.kitConfigurations[@43] = [[MPKitConfiguration alloc] init];
[MParticle sharedInstance].kitContainer_PRIVATE.kitConfigurations[@43] = [[MPKitConfiguration alloc] init];

XCTAssertEqual(MPKitContainer_PRIVATE.registeredKits.count, 1);

Expand Down
22 changes: 11 additions & 11 deletions mParticle-Apple-SDK/AppNotifications/MPAppNotificationHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ - (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error {
[queueParameters addParameter:error];

dispatch_async(dispatch_get_main_queue(), ^{
[[MParticle sharedInstance].kitContainer forwardSDKCall:failedRegistrationSelector
[[MParticle sharedInstance].kitContainer_PRIVATE forwardSDKCall:failedRegistrationSelector
event:nil
parameters:queueParameters
messageType:MPMessageTypeUnknown
Expand Down Expand Up @@ -98,7 +98,7 @@ - (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {
[queueParameters addParameter:deviceToken];

dispatch_async(dispatch_get_main_queue(), ^{
[[MParticle sharedInstance].kitContainer forwardSDKCall:deviceTokenSelector
[[MParticle sharedInstance].kitContainer_PRIVATE forwardSDKCall:deviceTokenSelector
event:nil
parameters:queueParameters
messageType:MPMessageTypePushRegistration
Expand All @@ -119,7 +119,7 @@ - (void)handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:
[queueParameters addParameter:userInfo];

dispatch_async(dispatch_get_main_queue(), ^{
[[MParticle sharedInstance].kitContainer forwardSDKCall:handleActionWithIdentifierSelector
[[MParticle sharedInstance].kitContainer_PRIVATE forwardSDKCall:handleActionWithIdentifierSelector
event:nil
parameters:queueParameters
messageType:MPMessageTypeUnknown
Expand All @@ -141,7 +141,7 @@ - (void)handleActionWithIdentifier:(NSString *)identifier forRemoteNotification:
[queueParameters addParameter:responseInfo];

dispatch_async(dispatch_get_main_queue(), ^{
[[MParticle sharedInstance].kitContainer forwardSDKCall:handleActionWithIdentifierSelector
[[MParticle sharedInstance].kitContainer_PRIVATE forwardSDKCall:handleActionWithIdentifierSelector
event:nil
parameters:queueParameters
messageType:MPMessageTypeUnknown
Expand Down Expand Up @@ -176,7 +176,7 @@ - (void) didReceiveRemoteNotification:(NSDictionary *)userInfo {
[queueParameters addParameter:userInfo];

dispatch_async(dispatch_get_main_queue(), ^{
[[MParticle sharedInstance].kitContainer forwardSDKCall:receivedNotificationSelector
[[MParticle sharedInstance].kitContainer_PRIVATE forwardSDKCall:receivedNotificationSelector
event:nil
parameters:queueParameters
messageType:MPMessageTypePushNotification
Expand All @@ -197,7 +197,7 @@ - (void)didUpdateUserActivity:(nonnull NSUserActivity *)userActivity {
[queueParameters addParameter:userActivity];

dispatch_async(dispatch_get_main_queue(), ^{
[[MParticle sharedInstance].kitContainer forwardSDKCall:didUpdateUserActivitySelector
[[MParticle sharedInstance].kitContainer_PRIVATE forwardSDKCall:didUpdateUserActivitySelector
event:nil
parameters:queueParameters
messageType:MPMessageTypeUnknown
Expand All @@ -219,7 +219,7 @@ - (void)userNotificationCenter:(nonnull UNUserNotificationCenter *)center willPr

dispatch_async(dispatch_get_main_queue(), ^{
SEL userNotificationCenterWillPresentNotification = @selector(userNotificationCenter:willPresentNotification:);
NSArray<id<MPExtensionKitProtocol>> *activeKitsRegistry = [[MParticle sharedInstance].kitContainer activeKitsRegistry];
NSArray<id<MPExtensionKitProtocol>> *activeKitsRegistry = [[MParticle sharedInstance].kitContainer_PRIVATE activeKitsRegistry];

for (id<MPExtensionKitProtocol> kitRegister in activeKitsRegistry) {
if ([kitRegister.wrapperInstance respondsToSelector:userNotificationCenterWillPresentNotification]) {
Expand Down Expand Up @@ -254,7 +254,7 @@ - (void)userNotificationCenter:(nonnull UNUserNotificationCenter *)center didRec

dispatch_async(dispatch_get_main_queue(), ^{
SEL userNotificationCenterDidReceiveNotificationResponse = @selector(userNotificationCenter:didReceiveNotificationResponse:);
NSArray<id<MPExtensionKitProtocol>> *activeKitsRegistry = [[MParticle sharedInstance].kitContainer activeKitsRegistry];
NSArray<id<MPExtensionKitProtocol>> *activeKitsRegistry = [[MParticle sharedInstance].kitContainer_PRIVATE activeKitsRegistry];

for (id<MPExtensionKitProtocol> kitRegister in activeKitsRegistry) {
if ([kitRegister.wrapperInstance respondsToSelector:userNotificationCenterDidReceiveNotificationResponse]) {
Expand Down Expand Up @@ -290,7 +290,7 @@ - (BOOL)continueUserActivity:(nonnull NSUserActivity *)userActivity restorationH
[queueParameters addParameter:restorationHandler];

dispatch_async(dispatch_get_main_queue(), ^{
[[MParticle sharedInstance].kitContainer forwardSDKCall:continueUserActivitySelector
[[MParticle sharedInstance].kitContainer_PRIVATE forwardSDKCall:continueUserActivitySelector
event:nil
parameters:queueParameters
messageType:MPMessageTypeUnknown
Expand Down Expand Up @@ -325,7 +325,7 @@ - (void)openURL:(NSURL *)url options:(NSDictionary<NSString *, id> *)options {
[queueParameters addParameter:options];

dispatch_async(dispatch_get_main_queue(), ^{
[[MParticle sharedInstance].kitContainer forwardSDKCall:openURLOptionsSelector
[[MParticle sharedInstance].kitContainer_PRIVATE forwardSDKCall:openURLOptionsSelector
event:nil
parameters:queueParameters
messageType:MPMessageTypeUnknown
Expand All @@ -352,7 +352,7 @@ - (void)openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication ann
[queueParameters addParameter:annotation];

dispatch_async(dispatch_get_main_queue(), ^{
[[MParticle sharedInstance].kitContainer forwardSDKCall:openURLSourceAppAnnotationSelector
[[MParticle sharedInstance].kitContainer_PRIVATE forwardSDKCall:openURLSourceAppAnnotationSelector
event:nil
parameters:queueParameters
messageType:MPMessageTypeUnknown
Expand Down
12 changes: 6 additions & 6 deletions mParticle-Apple-SDK/Identity/MPIdentityApi.m
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,10 @@ - (void)onMPIDChange:(MPIdentityApiRequest *)request httpResponse:(MPIdentityHTT
});
}

NSArray<NSDictionary *> *kitConfig = [[MParticle sharedInstance].kitContainer.originalConfig copy];
NSArray<NSDictionary *> *kitConfig = [[MParticle sharedInstance].kitContainer_PRIVATE.originalConfig copy];
if (kitConfig) {
dispatch_async(dispatch_get_main_queue(), ^{
[[MParticle sharedInstance].kitContainer configureKits:kitConfig];
[[MParticle sharedInstance].kitContainer_PRIVATE configureKits:kitConfig];
});
}
}
Expand All @@ -256,7 +256,7 @@ - (void)forwardCallToKits:(MPIdentityApiRequest *)request identityRequestType:(M
dispatch_async(dispatch_get_main_queue(), ^{
switch (identityRequestType) {
case MPIdentityRequestIdentify: {
[[MParticle sharedInstance].kitContainer forwardIdentitySDKCall:@selector(onIdentifyComplete: request:)
[[MParticle sharedInstance].kitContainer_PRIVATE forwardIdentitySDKCall:@selector(onIdentifyComplete: request:)
kitHandler:^(id<MPKitProtocol> kit, MPKitConfiguration *kitConfig) {
FilteredMParticleUser *filteredUser = [[FilteredMParticleUser alloc] initWithMParticleUser:user kitConfiguration:kitConfig];
FilteredMPIdentityApiRequest *filteredRequest = [[FilteredMPIdentityApiRequest alloc] initWithIdentityRequest:request kitConfiguration:kitConfig];
Expand All @@ -265,7 +265,7 @@ - (void)forwardCallToKits:(MPIdentityApiRequest *)request identityRequestType:(M
break;
}
case MPIdentityRequestLogin: {
[[MParticle sharedInstance].kitContainer forwardIdentitySDKCall:@selector(onLoginComplete: request:)
[[MParticle sharedInstance].kitContainer_PRIVATE forwardIdentitySDKCall:@selector(onLoginComplete: request:)
kitHandler:^(id<MPKitProtocol> kit, MPKitConfiguration *kitConfig) {
FilteredMParticleUser *filteredUser = [[FilteredMParticleUser alloc] initWithMParticleUser:user kitConfiguration:kitConfig];
FilteredMPIdentityApiRequest *filteredRequest = [[FilteredMPIdentityApiRequest alloc] initWithIdentityRequest:request kitConfiguration:kitConfig];
Expand All @@ -274,7 +274,7 @@ - (void)forwardCallToKits:(MPIdentityApiRequest *)request identityRequestType:(M
break;
}
case MPIdentityRequestLogout: {
[[MParticle sharedInstance].kitContainer forwardIdentitySDKCall:@selector(onLogoutComplete: request:)
[[MParticle sharedInstance].kitContainer_PRIVATE forwardIdentitySDKCall:@selector(onLogoutComplete: request:)
kitHandler:^(id<MPKitProtocol> kit, MPKitConfiguration *kitConfig) {
FilteredMParticleUser *filteredUser = [[FilteredMParticleUser alloc] initWithMParticleUser:user kitConfiguration:kitConfig];
FilteredMPIdentityApiRequest *filteredRequest = [[FilteredMPIdentityApiRequest alloc] initWithIdentityRequest:request kitConfiguration:kitConfig];
Expand All @@ -283,7 +283,7 @@ - (void)forwardCallToKits:(MPIdentityApiRequest *)request identityRequestType:(M
break;
}
case MPIdentityRequestModify: {
[[MParticle sharedInstance].kitContainer forwardIdentitySDKCall:@selector(onModifyComplete: request:)
[[MParticle sharedInstance].kitContainer_PRIVATE forwardIdentitySDKCall:@selector(onModifyComplete: request:)
kitHandler:^(id<MPKitProtocol> kit, MPKitConfiguration *kitConfig) {
FilteredMParticleUser *filteredUser = [[FilteredMParticleUser alloc] initWithMParticleUser:user kitConfiguration:kitConfig];
FilteredMPIdentityApiRequest *filteredRequest = [[FilteredMPIdentityApiRequest alloc] initWithIdentityRequest:request kitConfiguration:kitConfig];
Expand Down
Loading

0 comments on commit 621088d

Please sign in to comment.