Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support workspace switching #95

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading