Remove Mixpanel

pull/81/head
Niels Andriesse 5 years ago
parent b9727197e8
commit f3c36391b9

@ -46,7 +46,6 @@
#import <SignalServiceKit/TSSocketManager.h> #import <SignalServiceKit/TSSocketManager.h>
#import <YapDatabase/YapDatabaseCryptoUtils.h> #import <YapDatabase/YapDatabaseCryptoUtils.h>
#import <sys/utsname.h> #import <sys/utsname.h>
#import <Mixpanel/Mixpanel.h>
#import <FirebaseCore/FirebaseCore.h> #import <FirebaseCore/FirebaseCore.h>
@import WebRTC; @import WebRTC;
@ -355,12 +354,6 @@ static NSTimeInterval launchStartedAt;
// NSLog(@"[Loki] Failed to start P2P server."); // NSLog(@"[Loki] Failed to start P2P server.");
// } // }
// Loki - Set up beta analytics
[Mixpanel sharedInstanceWithToken:@"0410357303b7b6b45b740e6f0e6d34be"];
LKAnalytics.shared.trackImplementation = ^(NSString *event) {
NSDictionary *properties = @{ @"configuration" : LKBuildConfiguration.current };
[Mixpanel.sharedInstance track:event properties:properties];
};
#if DEBUG #if DEBUG
#else #else
[FIRApp configure]; [FIRApp configure];
@ -1261,7 +1254,6 @@ static NSTimeInterval launchStartedAt;
performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler performFetchWithCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler
{ {
NSLog(@"[Loki] Performing background fetch."); NSLog(@"[Loki] Performing background fetch.");
[LKAnalytics.shared track:@"Performed Background Fetch"];
[AppReadiness runNowOrWhenAppDidBecomeReady:^{ [AppReadiness runNowOrWhenAppDidBecomeReady:^{
NSMutableArray *promises = [NSMutableArray new]; NSMutableArray *promises = [NSMutableArray new];

@ -92,8 +92,6 @@
self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity"); self.title = NSLocalizedString(@"SETTINGS_NAV_BAR_TITLE", @"Title for settings activity");
[self updateTableContents]; [self updateTableContents];
[LKAnalytics.shared track:@"Settings Opened"];
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
@ -536,7 +534,6 @@
} }
UIActivityViewController *shareVC = [[UIActivityViewController alloc] initWithActivityItems:@[ hexEncodedPublicKey ] applicationActivities:nil]; UIActivityViewController *shareVC = [[UIActivityViewController alloc] initWithActivityItems:@[ hexEncodedPublicKey ] applicationActivities:nil];
[self presentViewController:shareVC animated:YES completion:nil]; [self presentViewController:shareVC animated:YES completion:nil];
[LKAnalytics.shared track:@"Public Key Shared"];
} }
- (void)showQRCode - (void)showQRCode

@ -462,7 +462,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
- (void)deleteThreadsAndMessages - (void)deleteThreadsAndMessages
{ {
[LKAnalytics.shared track:@"Conversation History Cleared"];
[ThreadUtil deleteAllContent]; [ThreadUtil deleteAllContent];
} }
@ -470,11 +469,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
{ {
BOOL enabled = sender.isOn; BOOL enabled = sender.isOn;
OWSLogInfo(@"toggled screen security: %@", enabled ? @"ON" : @"OFF"); OWSLogInfo(@"toggled screen security: %@", enabled ? @"ON" : @"OFF");
if (enabled) {
[LKAnalytics.shared track:@"Screen Security Enabled"];
} else {
[LKAnalytics.shared track:@"Screen Security Disabled"];
}
[self.preferences setScreenSecurity:enabled]; [self.preferences setScreenSecurity:enabled];
} }
@ -489,11 +483,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
{ {
BOOL enabled = sender.isOn; BOOL enabled = sender.isOn;
OWSLogInfo(@"toggled areTypingIndicatorsEnabled: %@", enabled ? @"ON" : @"OFF"); OWSLogInfo(@"toggled areTypingIndicatorsEnabled: %@", enabled ? @"ON" : @"OFF");
if (enabled) {
[LKAnalytics.shared track:@"Typing Indicators Enabled"];
} else {
[LKAnalytics.shared track:@"Typing Indicators Disabled"];
}
[self.typingIndicators setTypingIndicatorsEnabledWithValue:enabled]; [self.typingIndicators setTypingIndicatorsEnabledWithValue:enabled];
} }
@ -549,11 +538,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
- (void)didToggleLinkPreviewsEnabled:(UISwitch *)sender - (void)didToggleLinkPreviewsEnabled:(UISwitch *)sender
{ {
OWSLogInfo(@"toggled to: %@", (sender.isOn ? @"ON" : @"OFF")); OWSLogInfo(@"toggled to: %@", (sender.isOn ? @"ON" : @"OFF"));
if (sender.isOn) {
[LKAnalytics.shared track:@"Link Previews Enabled"];
} else {
[LKAnalytics.shared track:@"Link Previews Disabled"];
}
SSKPreferences.areLinkPreviewsEnabled = sender.isOn; SSKPreferences.areLinkPreviewsEnabled = sender.isOn;
} }
@ -576,12 +560,6 @@ static NSString *const kSealedSenderInfoURL = @"https://signal.org/blog/sealed-s
} }
OWSLogInfo(@"trying to set is screen lock enabled: %@", @(shouldBeEnabled)); OWSLogInfo(@"trying to set is screen lock enabled: %@", @(shouldBeEnabled));
if (shouldBeEnabled) {
[LKAnalytics.shared track:@"Screen Lock Enabled"];
} else {
[LKAnalytics.shared track:@"Screen Lock Disabled"];
}
[OWSScreenLock.sharedManager setIsScreenLockEnabled:shouldBeEnabled]; [OWSScreenLock.sharedManager setIsScreenLockEnabled:shouldBeEnabled];
} }

@ -404,8 +404,6 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
if ([OWSProfileManager.sharedManager isProfileNameTooLong:normalizedProfileName]) { if ([OWSProfileManager.sharedManager isProfileNameTooLong:normalizedProfileName]) {
return [OWSAlerts showErrorAlertWithMessage:NSLocalizedString(@"Please pick a shorter display name", @"")]; return [OWSAlerts showErrorAlertWithMessage:NSLocalizedString(@"Please pick a shorter display name", @"")];
} }
[LKAnalytics.shared track:@"Display Name Updated"];
// Show an activity indicator to block the UI during the profile upload. // Show an activity indicator to block the UI during the profile upload.
[ModalActivityIndicatorViewController [ModalActivityIndicatorViewController

@ -74,8 +74,6 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
stackView.autoPin(toBottomLayoutGuideOf: self, withInset: 0) stackView.autoPin(toBottomLayoutGuideOf: self, withInset: 0)
lokiLogoImageView.autoCenterInSuperview() lokiLogoImageView.autoCenterInSuperview()
Analytics.shared.track("Landing Screen Viewed")
if UserDefaults.standard.bool(forKey: "wasUnlinked") { if UserDefaults.standard.bool(forKey: "wasUnlinked") {
let alert = UIAlertController(title: NSLocalizedString("Device Unlinked", comment: ""), message: NSLocalizedString("Your device was unlinked successfully", comment: ""), preferredStyle: .alert) let alert = UIAlertController(title: NSLocalizedString("Device Unlinked", comment: ""), message: NSLocalizedString("Your device was unlinked successfully", comment: ""), preferredStyle: .alert)
alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), accessibilityIdentifier: nil, style: .default, handler: nil)) alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), accessibilityIdentifier: nil, style: .default, handler: nil))

@ -78,7 +78,6 @@ public extension LokiAPI {
return randomSnodePool.randomElement()! return randomSnodePool.randomElement()!
}.recover(on: DispatchQueue.global()) { error -> Promise<LokiAPITarget> in }.recover(on: DispatchQueue.global()) { error -> Promise<LokiAPITarget> in
print("[Loki] Failed to contact seed node at: \(target).") print("[Loki] Failed to contact seed node at: \(target).")
Analytics.shared.track("Seed Node Failed")
throw error throw error
}.retryingIfNeeded(maxRetryCount: 16) // The seed nodes have historically been unreliable }.retryingIfNeeded(maxRetryCount: 16) // The seed nodes have historically been unreliable
} else { } else {

@ -174,13 +174,7 @@ public final class LokiPublicChatAPI : LokiDotNetAPI {
storage.dbReadWriteConnection.removeObject(forKey: server, inCollection: authTokenCollection) storage.dbReadWriteConnection.removeObject(forKey: server, inCollection: authTokenCollection)
} }
throw error throw error
}.retryingIfNeeded(maxRetryCount: maxRetryCount).map { message in }.retryingIfNeeded(maxRetryCount: maxRetryCount)
Analytics.shared.track("Group Message Sent")
return message
}.recover(on: DispatchQueue.global()) { error -> Promise<LokiPublicChatMessage> in
Analytics.shared.track("Failed to Send Group Message")
throw error
}
} }
public static func getDeletedMessageServerIDs(for channel: UInt64, on server: String) -> Promise<[UInt64]> { public static func getDeletedMessageServerIDs(for channel: UInt64, on server: String) -> Promise<[UInt64]> {

Loading…
Cancel
Save