Skip to content

add param 'trackAutomaticEvents' to 'init' - #86

Merged
zihejia merged 4 commits into
mainfrom
deprecate-decide
Sep 9, 2022
Merged

zihejia merged 4 commits into
mainfrom
deprecate-decide

Conversation

@zihejia

@zihejia zihejia commented Aug 8, 2022 •

Copy link
Copy Markdown
Contributor

Since this PR, we are deprecating the Automatically collect common mobile events
setting from Mixpanel website in favor of reducing crashes and race conditions when collecting common mobile events.

image

Alternatively, you can specify trackAutomaticEvents in init

@zihejia
zihejia requested a review from jaredmixpanel August 8, 2022 18:38

mixpanel = MixpanelAPI.getInstance(context, token,
optOutTrackingDefault == null ? false : optOutTrackingDefault,
superAndMixpanelProperties, null, trackAutomaticEvents == null ? false : true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trackAutomaticEvents should never == null, right?

self.token = token
let trackAutomaticEvents = arguments["trackAutomaticEvents"] as? Bool
instance = Mixpanel.initialize(token: token!, instanceName: token!,
trackAutomaticEvents: trackAutomaticEvents ?? true,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, this should be required with no default value.

Comment thread lib/mixpanel_flutter.dart Outdated
/// * [token] your project token.
/// * [optOutTrackingDefault] Optional Whether or not Mixpanel can start tracking by default. See
/// optOutTracking()
/// * [trackAutomaticEvents] Optional Whether or not to collect common mobile events

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not be Optional

Comment thread lib/mixpanel_flutter.dart Outdated
///
static Future<Mixpanel> init(String token,
{bool optOutTrackingDefault = false,
bool trackAutomaticEvents = true,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there shouldn't be a default value

@jaredmixpanel jaredmixpanel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zihejia
zihejia merged commit 972027b into main Sep 9, 2022
@zihejia zihejia added the enhancement New feature or request label Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants