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

BrazeLocationProvider added to make automatic location collection works #82

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
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
9 changes: 8 additions & 1 deletion Sources/mParticle-Appboy/MPKitAppboy.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@import BrazeKit;
@import BrazeKitCompat;
@import BrazeUI;
@import BrazeLocation;
#else
@import BrazeKit;
@import BrazeKitCompat;
Expand Down Expand Up @@ -309,10 +310,16 @@ - (void)start {
configuration.api.flushInterval = ((NSNumber *)optionsDict[ABKFlushIntervalOptionKey]).doubleValue;
configuration.sessionTimeout = ((NSNumber *)optionsDict[ABKSessionTimeoutKey]).doubleValue;
configuration.triggerMinimumTimeInterval = ((NSNumber *)optionsDict[ABKMinimumTriggerTimeIntervalKey]).doubleValue;
configuration.location.automaticLocationCollection = optionsDict[ABKEnableAutomaticLocationCollectionKey];
configuration.location.automaticLocationCollection = ((NSNumber *)optionsDict[ABKEnableAutomaticLocationCollectionKey]).boolValue;
if (configuration.location.automaticLocationCollection) {
configuration.location.brazeLocationProvider = [[BrazeLocationProvider alloc] init];
}
[configuration.api addSDKMetadata:@[BRZSDKMetadata.mparticle]];
configuration.api.sdkFlavor = ((NSNumber *)optionsDict[ABKSDKFlavorKey]).intValue;

// enable verbose loggings added by Nahuel TSE mParticle
configuration.logger.level = BRZLoggerLevelDebug;

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

Expand Down