Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
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
24 changes: 19 additions & 5 deletions RNMixpanel/Mixpanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,31 @@

/*!
@property

@abstract
If set, determines the background color of mini notifications.

@discussion
If this isn't set, we default to either the color of the UINavigationBar of the top
UINavigationController that is showing when the notification is presented, the
If this isn't set, we default to either the color of the UINavigationBar of the top
UINavigationController that is showing when the notification is presented, the
UINavigationBar default color for the app or the UITabBar default color.
*/
@property (atomic) UIColor* miniNotificationBackgroundColor;

/*!
@property

The minimum session duration (ms) that is tracked in automatic events.
*/
@property (atomic) UInt64 minimumSessionDuration;

/*!
@property

The maximum session duration (ms) that is tracked in automatic events.
*/
@property (atomic) UInt64 maximumSessionDuration;

/*!
@property

Expand Down Expand Up @@ -556,10 +570,10 @@

/*!
@method

@abstract
Calls flush, then optionally archives and calls a handler when finished.

@discussion
When calling <code>flush</code> manually, it is sometimes important to verify
that the flush has finished before further action is taken. This is
Expand Down
14 changes: 14 additions & 0 deletions RNMixpanel/RNMixpanel.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,20 @@ -(Mixpanel*) getInstance: (NSString *)name {
}
}

// setAppSessionProperties iOS
RCT_EXPORT_METHOD(setAppSessionPropertiesIOS:(NSDictionary *)properties) {
if ([properties objectForKey:@"minimumSessionDuration"]) {
NSNumber *minimumSessionDuration = properties[@"minimumSessionDuration"];
long long int intValue = [minimumSessionDuration longLongValue];
mixpanel.minimumSessionDuration = intValue;
}

if ([properties objectForKey:@"maximumSessionDuration"]) {
NSNumber *maximumSessionDuration = properties[@"maximumSessionDuration"];
long long int intValue = [maximumSessionDuration longLongValue];
mixpanel.maximumSessionDuration = intValue;
}
}

// get distinct id
RCT_EXPORT_METHOD(getDistinctId:(NSString *)apiToken
Expand Down