Skip to content

Commit

Permalink
feat: Support workspace switching (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrandonStalnaker authored Oct 2, 2024
1 parent 0b10d7e commit a80ce1d
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions Sources/mParticle-Appboy/MPKitAppboy.m
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ - (MPKitExecStatus *)logAppboyCustomEvent:(MPEvent *)event eventType:(NSUInteger
if (self->_enableTypeDetection) {
detectedEventInfo = [self simplifiedDictionary:eventInfo];
}

// Appboy expects that the properties are non empty when present.
if (detectedEventInfo && detectedEventInfo.count > 0) {
[self->appboyInstance logCustomEvent:event.name properties:detectedEventInfo];
Expand Down Expand Up @@ -315,7 +315,7 @@ - (MPKitExecStatus *)didFinishLaunchingWithConfiguration:(NSDictionary *)configu
}

_configuration = configuration;

collectIDFA = NO;
forwardScreenViews = NO;

Expand Down Expand Up @@ -356,7 +356,7 @@ - (void)start {
NSNumber *flushIntervalOption = (NSNumber *)optionsDict[ABKFlushIntervalOptionKey] ?: @10; // If not set, use the default 10 seconds specified in Braze SDK header
configuration.api.flushInterval = flushIntervalOption.doubleValue < 1.0 ? 1.0 : flushIntervalOption.doubleValue; // Ensure value is above the minimum of 1.0 per run time warning from Braze SDK
configuration.api.trackingPropertyAllowList = brazeTrackingPropertyAllowList;

configuration.sessionTimeout = ((NSNumber *)optionsDict[ABKSessionTimeoutKey]).doubleValue;

configuration.triggerMinimumTimeInterval = ((NSNumber *)optionsDict[ABKMinimumTriggerTimeIntervalKey]).doubleValue;
Expand All @@ -366,7 +366,7 @@ - (void)start {
configuration.location.automaticLocationCollection = YES;
configuration.location.brazeLocationProvider = brazeLocationProvider;
}

self->appboyInstance = [[Braze alloc] initWithConfiguration:configuration];
}

Expand Down Expand Up @@ -407,6 +407,12 @@ - (void)start {
});
}

- (void)stop {
self->appboyInstance = nil;
_started = NO;
_configuration = nil;
}

- (NSMutableDictionary<NSString *, NSObject *> *)optionsDictionary {
NSArray <NSString *> *serverKeys = @[@"ABKRequestProcessingPolicyOptionKey", @"ABKFlushIntervalOptionKey", @"ABKSessionTimeoutKey", @"ABKMinimumTriggerTimeIntervalKey"];
NSArray <NSString *> *appboyKeys = @[ABKRequestProcessingPolicyOptionKey, ABKFlushIntervalOptionKey, ABKSessionTimeoutKey, ABKMinimumTriggerTimeIntervalKey];
Expand Down

0 comments on commit a80ce1d

Please sign in to comment.