11#import " MPKitAppboy.h"
22
3- #if SWIFT_PACKAGE
4- #ifdef TARGET_OS_IOS
5- @import BrazeKit;
6- @import BrazeKitCompat;
7- @import BrazeUI;
8- #else
9- @import BrazeKit;
10- @import BrazeKitCompat;
11- #endif
3+ #if TARGET_OS_IOS
4+ @import BrazeKit;
5+ @import BrazeKitCompat;
6+ @import BrazeUI;
127#else
13- #ifdef TARGET_OS_IOS
14- @import BrazeKit;
15- @import BrazeKitCompat;
16- @import BrazeUI;
17- #else
18- @import BrazeKit;
19- @import BrazeKitCompat;
20- #endif
8+ @import BrazeKit;
9+ @import BrazeKitCompat;
2110#endif
2211
2312static NSString *const eabAPIKey = @" apiKey" ;
5140// User Attribute key with reserved functionality for Braze kit
5241static NSString *const brazeUserAttributeDob = @" dob" ;
5342
54- #ifdef TARGET_OS_IOS
43+ #if TARGET_OS_IOS
5544__weak static id <BrazeInAppMessageUIDelegate> inAppMessageControllerDelegate = nil ;
5645#endif
5746__weak static id <BrazeDelegate> urlDelegate = nil ;
@@ -79,7 +68,7 @@ + (void)load {
7968 [MParticle registerExtension: kitRegister];
8069}
8170
82- #ifdef TARGET_OS_IOS
71+ #if TARGET_OS_IOS
8372+ (void )setInAppMessageControllerDelegate : (id )delegate {
8473 inAppMessageControllerDelegate = (id <BrazeInAppMessageUIDelegate>)delegate;
8574}
@@ -169,13 +158,13 @@ - (MPKitExecStatus *)logAppboyCustomEvent:(MPEvent *)event eventType:(NSUInteger
169158 // Delete from array
170159 forwardUserAttributes = self.configuration [@" ear" ];
171160 if (forwardUserAttributes[hashValue]) {
172- [self ->appboyInstance.user removeFromCustomAttributeArrayWithKey : forwardUserAttributes[hashValue] value: eventInfo[key]];
161+ [self ->appboyInstance.user removeFromCustomAttributeStringArrayWithKey : forwardUserAttributes[hashValue] value: eventInfo[key]];
173162 }
174163
175164 // Add to array
176165 forwardUserAttributes = self.configuration [@" eaa" ];
177166 if (forwardUserAttributes[hashValue]) {
178- [self ->appboyInstance.user addToCustomAttributeArrayWithKey : forwardUserAttributes[hashValue] value: eventInfo[key]];
167+ [self ->appboyInstance.user addToCustomAttributeStringArrayWithKey : forwardUserAttributes[hashValue] value: eventInfo[key]];
179168 }
180169
181170 // Add key/value pair
@@ -302,7 +291,7 @@ - (void)start {
302291 [self ->appboyInstance setAdTrackingEnabled: [self isAdvertisingTrackingEnabled ]];
303292 }
304293
305- #ifdef TARGET_OS_IOS
294+ #if TARGET_OS_IOS
306295 if ([MPKitAppboy inAppMessageControllerDelegate ]) {
307296 BrazeInAppMessageUI *inAppMessageUI = [[BrazeInAppMessageUI alloc ] init ];
308297 inAppMessageUI.delegate = [MPKitAppboy inAppMessageControllerDelegate ];
@@ -371,7 +360,7 @@ - (void)start {
371360 optionsDictionary[ABKSDKFlavorKey] = @(MPARTICLE );
372361#pragma clang diagnostic pop
373362
374- #ifdef TARGET_OS_IOS
363+ #if TARGET_OS_IOS
375364 optionsDictionary[ABKEnableAutomaticLocationCollectionKey] = @(YES );
376365 if (self.configuration [@" ABKDisableAutomaticLocationCollectionKey" ]) {
377366 if ([self .configuration[@" ABKDisableAutomaticLocationCollectionKey" ] caseInsensitiveCompare: @" true" ] == NSOrderedSame) {
@@ -492,7 +481,7 @@ - (MPKitExecStatus *)logScreen:(MPEvent *)event {
492481- (MPKitExecStatus *)receivedUserNotification : (NSDictionary *)userInfo {
493482 MPKitExecStatus *execStatus = [[MPKitExecStatus alloc ] initWithSDKCode: @(MPKitInstanceAppboy) returnCode: MPKitReturnCodeSuccess];
494483
495- #ifdef TARGET_OS_IOS
484+ #if TARGET_OS_IOS
496485 if (![appboyInstance.notifications handleBackgroundNotificationWithUserInfo: userInfo fetchCompletionHandler: ^(UIBackgroundFetchResult fetchResult) {}]) {
497486 execStatus = [[MPKitExecStatus alloc ] initWithSDKCode: @(MPKitInstanceAppboy) returnCode: MPKitReturnCodeFail];
498487 }
@@ -509,7 +498,7 @@ - (MPKitExecStatus *)removeUserAttribute:(NSString *)key {
509498}
510499
511500- (MPKitExecStatus *)setDeviceToken : (NSData *)deviceToken {
512- #ifdef TARGET_OS_IOS
501+ #if TARGET_OS_IOS
513502 [appboyInstance.notifications registerDeviceToken: deviceToken];
514503#endif
515504
@@ -862,7 +851,7 @@ - (MPKitExecStatus *)setUserIdentity:(NSString *)identityString identityType:(MP
862851 return [[MPKitExecStatus alloc ] initWithSDKCode: @(MPKitInstanceAppboy) returnCode: MPKitReturnCodeSuccess];
863852}
864853
865- #ifdef TARGET_OS_IOS
854+ #if TARGET_OS_IOS
866855- (nonnull MPKitExecStatus *)userNotificationCenter : (nonnull UNUserNotificationCenter *)center didReceiveNotificationResponse : (nonnull UNNotificationResponse *)response API_AVAILABLE(ios(10.0 )) {
867856 MPKitExecStatus *execStatus = [[MPKitExecStatus alloc ] initWithSDKCode: @(MPKitInstanceAppboy) returnCode: MPKitReturnCodeSuccess];
868857
0 commit comments