From 1fc5f401b4eed836c47d9e0705a5b66d38c9df1f Mon Sep 17 00:00:00 2001 From: v-mamaya <136605018+v-mamaya@users.noreply.github.com> Date: Thu, 2 Nov 2023 13:38:03 -0300 Subject: [PATCH] fix: Bundle commerce event setting (#83) * Fixing VALID_ARCHS defaults for the project (needed for M1+ arch) * Fixing tests, bundlecommmerceevent explicit setting * Fixing the bundlecommerceevent config override --- Sources/mParticle-Appboy/MPKitAppboy.m | 4 ---- mParticle-Appboy.xcodeproj/project.pbxproj | 8 +------- mParticle_AppboyTests/mParticle_AppboyTests.m | 2 ++ 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Sources/mParticle-Appboy/MPKitAppboy.m b/Sources/mParticle-Appboy/MPKitAppboy.m index 439fd7a..a1c7935 100644 --- a/Sources/mParticle-Appboy/MPKitAppboy.m +++ b/Sources/mParticle-Appboy/MPKitAppboy.m @@ -405,10 +405,6 @@ - (nonnull MPKitExecStatus *)logBaseEvent:(nonnull MPBaseEvent *)event { - (MPKitExecStatus *)routeCommerceEvent:(MPCommerceEvent *)commerceEvent { MPKitExecStatus *execStatus = [[MPKitExecStatus alloc] initWithSDKCode:@(MPKitInstanceAppboy) returnCode:MPKitReturnCodeSuccess forwardCount:0]; - NSMutableDictionary *mutDict = [_configuration mutableCopy]; - mutDict[bundleCommerceEventData] = @true; - _configuration = mutDict; - if (commerceEvent.action == MPCommerceEventActionPurchase) { NSMutableDictionary *baseProductAttributes = [[NSMutableDictionary alloc] init]; NSDictionary *transactionAttributes = [self simplifiedDictionary:[commerceEvent.transactionAttributes beautifiedDictionaryRepresentation]]; diff --git a/mParticle-Appboy.xcodeproj/project.pbxproj b/mParticle-Appboy.xcodeproj/project.pbxproj index 8dfc9a8..e1103c2 100644 --- a/mParticle-Appboy.xcodeproj/project.pbxproj +++ b/mParticle-Appboy.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ @@ -727,7 +727,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.mParticle-Appboy"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; - "VALID_ARCHS[sdk=iphonesimulator*]" = x86_64; }; name = Debug; }; @@ -745,7 +744,6 @@ PRODUCT_BUNDLE_IDENTIFIER = "com.mparticle.mParticle-Appboy"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SKIP_INSTALL = YES; - "VALID_ARCHS[sdk=iphonesimulator*]" = x86_64; }; name = Release; }; @@ -787,8 +785,6 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - VALID_ARCHS = arm64; - "VALID_ARCHS[sdk=appletvsimulator*]" = x86_64; }; name = Debug; }; @@ -830,8 +826,6 @@ SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - VALID_ARCHS = arm64; - "VALID_ARCHS[sdk=appletvsimulator*]" = x86_64; }; name = Release; }; diff --git a/mParticle_AppboyTests/mParticle_AppboyTests.m b/mParticle_AppboyTests/mParticle_AppboyTests.m index 93ac2c7..5e9cbd9 100644 --- a/mParticle_AppboyTests/mParticle_AppboyTests.m +++ b/mParticle_AppboyTests/mParticle_AppboyTests.m @@ -313,6 +313,7 @@ - (void)testUserIdMPID { - (void)testlogCommerceEvent { MPKitAppboy *kit = [[MPKitAppboy alloc] init]; + kit.configuration = @{@"bundleCommerceEventData" : @0}; BRZConfiguration *configuration = [[BRZConfiguration alloc] init]; Braze *testClient = [[Braze alloc] initWithConfiguration:configuration]; @@ -399,6 +400,7 @@ - (void)testlogCommerceEventWithBundledProducts { - (void)testlogPurchaseCommerceEvent { MPKitAppboy *kit = [[MPKitAppboy alloc] init]; + kit.configuration = @{@"bundleCommerceEventData" : @0}; BRZConfiguration *configuration = [[BRZConfiguration alloc] init]; Braze *testClient = [[Braze alloc] initWithConfiguration:configuration];