From 1bac57c2abd2278e58201966e00d7adeb092abe4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Amaya?= Date: Tue, 18 Jun 2024 15:46:53 -0300 Subject: [PATCH 1/3] adding forward screen events config reading when using an already initialized instance from Braze --- Sources/mParticle-Appboy/MPKitAppboy.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/mParticle-Appboy/MPKitAppboy.m b/Sources/mParticle-Appboy/MPKitAppboy.m index 5225fd5..f67434a 100644 --- a/Sources/mParticle-Appboy/MPKitAppboy.m +++ b/Sources/mParticle-Appboy/MPKitAppboy.m @@ -362,6 +362,10 @@ - (void)start { return; } + if (self.configuration[@"forwardScreenViews"]) { + self->forwardScreenViews = [self.configuration[@"forwardScreenViews"] caseInsensitiveCompare:@"true"] == NSOrderedSame; + } + if (self->collectIDFA) { [self->appboyInstance setIdentifierForAdvertiser:[self advertisingIdentifierString]]; } From 43c9c011db908a2342b94fed82c342c1a219c718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Amaya?= Date: Tue, 18 Jun 2024 17:08:30 -0300 Subject: [PATCH 2/3] moving collectIDFA setting out of options dictionary to avoid side effects there --- Sources/mParticle-Appboy/MPKitAppboy.m | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Sources/mParticle-Appboy/MPKitAppboy.m b/Sources/mParticle-Appboy/MPKitAppboy.m index f67434a..fba0dbe 100644 --- a/Sources/mParticle-Appboy/MPKitAppboy.m +++ b/Sources/mParticle-Appboy/MPKitAppboy.m @@ -366,6 +366,8 @@ - (void)start { self->forwardScreenViews = [self.configuration[@"forwardScreenViews"] caseInsensitiveCompare:@"true"] == NSOrderedSame; } + self->collectIDFA = self.configuration[@"ABKCollectIDFA"] && [self.configuration[@"ABKCollectIDFA"] caseInsensitiveCompare:@"true"] == NSOrderedSame; + if (self->collectIDFA) { [self->appboyInstance setIdentifierForAdvertiser:[self advertisingIdentifierString]]; } @@ -419,14 +421,6 @@ - (void)start { } }]; - self->collectIDFA = self.configuration[@"ABKCollectIDFA"] && [self.configuration[@"ABKCollectIDFA"] caseInsensitiveCompare:@"true"] == NSOrderedSame; - if (self->collectIDFA) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wincompatible-pointer-types" - optionsDictionary[ABKIDFADelegateKey] = (id)self; -#pragma clang diagnostic pop - } - if (self.host.length) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wincompatible-pointer-types" @@ -434,10 +428,6 @@ - (void)start { #pragma clang diagnostic pop } - if (self.configuration[@"forwardScreenViews"]) { - self->forwardScreenViews = [self.configuration[@"forwardScreenViews"] caseInsensitiveCompare:@"true"] == NSOrderedSame; - } - if (optionsDictionary.count == 0) { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wincompatible-pointer-types" From 68ac1b37c712ee38e615bdf6bd2f2c4b8b6214f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Amaya?= Date: Tue, 18 Jun 2024 17:22:55 -0300 Subject: [PATCH 3/3] matching syntax in setting the instance variables --- Sources/mParticle-Appboy/MPKitAppboy.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/mParticle-Appboy/MPKitAppboy.m b/Sources/mParticle-Appboy/MPKitAppboy.m index fba0dbe..18bf6db 100644 --- a/Sources/mParticle-Appboy/MPKitAppboy.m +++ b/Sources/mParticle-Appboy/MPKitAppboy.m @@ -362,9 +362,7 @@ - (void)start { return; } - if (self.configuration[@"forwardScreenViews"]) { - self->forwardScreenViews = [self.configuration[@"forwardScreenViews"] caseInsensitiveCompare:@"true"] == NSOrderedSame; - } + self->forwardScreenViews = self.configuration[@"forwardScreenViews"] && [self.configuration[@"forwardScreenViews"] caseInsensitiveCompare:@"true"] == NSOrderedSame; self->collectIDFA = self.configuration[@"ABKCollectIDFA"] && [self.configuration[@"ABKCollectIDFA"] caseInsensitiveCompare:@"true"] == NSOrderedSame;