@@ -39,40 +39,47 @@ class Mixpanel {
39
39
/// Set the base URL used for Mixpanel API requests.
40
40
/// Useful if you need to proxy Mixpanel requests. Defaults to https://api.mixpanel.com.
41
41
/// To route data to Mixpanel's EU servers, set to https://api-eu.mixpanel.com
42
- /// - Note: This method will only work for iOS. For android, please refer to:
43
- /// https://developer.mixpanel.com/docs/android
44
42
///
45
43
/// * [serverURL] the base URL used for Mixpanel API requests
46
44
void setServerURL (String serverURL) {
47
- if (Platform .isIOS) {
48
- if (_MixpanelHelper .isValidString (serverURL)) {
49
- _channel.invokeMethod <void >(
50
- 'setServerURL' , < String , dynamic > {'serverURL' : serverURL});
51
- } else {
52
- developer.log ('`setServerURL` failed: serverURL cannot be blank' ,
53
- name: 'Mixpanel' );
54
- }
45
+ if (_MixpanelHelper .isValidString (serverURL)) {
46
+ _channel.invokeMethod <void >(
47
+ 'setServerURL' , < String , dynamic > {'serverURL' : serverURL});
48
+ } else {
49
+ developer.log ('`setServerURL` failed: serverURL cannot be blank' ,
50
+ name: 'Mixpanel' );
55
51
}
56
52
}
57
53
58
54
/// This allows enabling or disabling of all Mixpanel logs at run time.
59
- /// - Note: This method will only work for iOS. For android, please refer to:
60
- /// https://developer.mixpanel.com/docs/android
61
55
/// All logging is disabled by default. Usually, this is only required if
62
56
/// you are running into issues with the SDK that you want to debug
63
57
///
64
58
/// * [loggingEnabled] whether to enable logging
65
59
void setLoggingEnabled (bool loggingEnabled) {
66
- if (Platform .isIOS) {
67
- // ignore: unnecessary_null_comparison
68
- if (loggingEnabled != null ) {
69
- _channel.invokeMethod <void >('setLoggingEnabled' ,
70
- < String , dynamic > {'loggingEnabled' : loggingEnabled});
71
- } else {
72
- developer.log (
73
- '`setLoggingEnabled` failed: loggingEnabled cannot be blank' ,
74
- name: 'Mixpanel' );
75
- }
60
+ if (loggingEnabled != null ) { // ignore: unnecessary_null_comparison
61
+ _channel.invokeMethod <void >('setLoggingEnabled' ,
62
+ < String , dynamic > {'loggingEnabled' : loggingEnabled});
63
+ } else {
64
+ developer.log (
65
+ '`setLoggingEnabled` failed: loggingEnabled cannot be blank' ,
66
+ name: 'Mixpanel' );
67
+ }
68
+ }
69
+
70
+ /// This controls whether to automatically send the client IP Address as part of event tracking.
71
+ /// With an IP address, geo-location is possible down to neighborhoods within a city,
72
+ /// although the Mixpanel Dashboard will just show you city level location specificity.
73
+ ///
74
+ /// * [useIpAddressForGeolocation] whether to automatically send the client IP Address. Defaults to true.
75
+ void setUseIpAddressForGeolocation (bool useIpAddressForGeolocation) {
76
+ if (useIpAddressForGeolocation != null ) { // ignore: unnecessary_null_comparison
77
+ _channel.invokeMethod <void >('setUseIpAddressForGeolocation' ,
78
+ < String , dynamic > {'useIpAddressForGeolocation' : useIpAddressForGeolocation});
79
+ } else {
80
+ developer.log (
81
+ '`setUseIpAddressForGeolocation` failed: useIpAddressForGeolocation cannot be blank' ,
82
+ name: 'Mixpanel' );
76
83
}
77
84
}
78
85
0 commit comments