mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 15:09:31 +02:00
MESSENGER-4454 get serverurls for maintenance and matomo from the right place
This commit is contained in:
@@ -467,11 +467,7 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
|
||||
// Configure our analytics. It will indeed start if the option is enabled
|
||||
Analytics *analytics = [Analytics shared];
|
||||
|
||||
[MXSDKOptions sharedInstance].analyticsDelegate = BWIAnalytics.sharedTracker;
|
||||
[DecryptionFailureTracker sharedInstance].delegate = BWIAnalytics.sharedTracker;
|
||||
|
||||
|
||||
MXBaseProfiler *profiler = [MXBaseProfiler new];
|
||||
profiler.analytics = analytics;
|
||||
[MXSDKOptions sharedInstance].profiler = profiler;
|
||||
@@ -1909,6 +1905,10 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
{
|
||||
// Configure analytics from the session if necessary
|
||||
[Analytics.shared useAnalyticsSettingsFrom:mxSession];
|
||||
|
||||
// bwi: add session to app config
|
||||
AppConfigService.shared.session = mxSession;
|
||||
[BWIAnalytics.sharedTracker setSessionWithSession:mxSession];
|
||||
}
|
||||
else if (mxSession.state == MXSessionStateClosed)
|
||||
{
|
||||
@@ -2099,8 +2099,6 @@ NSString *const AppDelegateUniversalLinkDidChangeNotification = @"AppDelegateUni
|
||||
// Do the one time check on device id
|
||||
[self checkDeviceId:mxSession];
|
||||
|
||||
[BWIAnalytics.sharedTracker setSessionWithSession:mxSession];
|
||||
|
||||
[self.delegate legacyAppDelegate:self didAddMatrixSession:mxSession];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,8 @@ extension UserDefaults
|
||||
|
||||
var configObserver: NSKeyValueObservation!
|
||||
|
||||
var session: MXSession?
|
||||
|
||||
private func loadAppConfig() {
|
||||
do {
|
||||
if let dataIn = UserDefaults.standard.value(forKey: savedConfig) as? Data {
|
||||
@@ -136,6 +138,8 @@ extension UserDefaults
|
||||
return url
|
||||
} else if let url = ServerURLHelper.shared.serverUrl() {
|
||||
return url
|
||||
} else if let session = session, let restClient = session.matrixRestClient {
|
||||
return restClient.homeserver
|
||||
} else {
|
||||
return BWIBuildSettings.shared.serverConfigDefaultHomeserverUrlString
|
||||
}
|
||||
|
||||
@@ -34,10 +34,6 @@ import MatomoTracker
|
||||
}
|
||||
fastRunning = enabled
|
||||
BWIAnalyticsAccountDataService(mxSession: session).setEnabled(enabled)
|
||||
|
||||
if enabled {
|
||||
resetMatomo()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,6 +61,8 @@ import MatomoTracker
|
||||
|
||||
super.init()
|
||||
|
||||
MXSDKOptions.sharedInstance().analyticsDelegate = self
|
||||
|
||||
resetMatomo()
|
||||
}
|
||||
|
||||
@@ -114,7 +112,7 @@ import MatomoTracker
|
||||
return BWIAnalyticsAccountDataService(mxSession: session).needsToShowPromt()
|
||||
}
|
||||
|
||||
private func resetMatomo() {
|
||||
func resetMatomo() {
|
||||
if BWIBuildSettings.shared.bwiMatomoEnabled {
|
||||
|
||||
if let path = Bundle.main.path(forResource: "trackingConfig", ofType: "json") {
|
||||
|
||||
@@ -54,7 +54,7 @@ import Foundation
|
||||
guard let analyticsArray = session.accountData.accountData(forEventType: AccountDataTypes.analytics) as? [String: Any] else {
|
||||
return true
|
||||
}
|
||||
guard analyticsArray[session.myDeviceId] is [String: Any] else {
|
||||
guard let deviceID = session.myDeviceId, analyticsArray[deviceID] is [String: Any] else {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user