Skip to content

Commit

Permalink
cleaning
Browse files Browse the repository at this point in the history
Signed-off-by: Marino Faggiana <[email protected]>
  • Loading branch information
marinofaggiana committed Jun 25, 2024
1 parent 1d331c2 commit 755e07d
Show file tree
Hide file tree
Showing 35 changed files with 3 additions and 265 deletions.
15 changes: 3 additions & 12 deletions iOSClient/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
@discussion Schedule a refresh task request to ask that the system launch your app briefly so that you can download data and keep your app's contents up-to-date. The system will fulfill this request intelligently based on system conditions and app usage.
*/
func scheduleAppRefresh() {

let request = BGAppRefreshTaskRequest(identifier: NCGlobal.shared.refreshTask)

request.earliestBeginDate = Date(timeIntervalSinceNow: 60) // Refresh after 60 seconds.
do {
try BGTaskScheduler.shared.submit(request)
Expand All @@ -202,8 +202,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
@discussion Schedule a processing task request to ask that the system launch your app when conditions are favorable for battery life to handle deferrable, longer-running processing, such as syncing, database maintenance, or similar tasks. The system will attempt to fulfill this request to the best of its ability within the next two days as long as the user has used your app within the past week.
*/
func scheduleAppProcessing() {

let request = BGProcessingTaskRequest(identifier: NCGlobal.shared.processingTask)

request.earliestBeginDate = Date(timeIntervalSinceNow: 5 * 60) // Refresh after 5 minutes.
request.requiresNetworkConnectivity = false
request.requiresExternalPower = false
Expand Down Expand Up @@ -275,7 +275,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
// MARK: - Background Networking Session

func application(_ application: UIApplication, handleEventsForBackgroundURLSession identifier: String, completionHandler: @escaping () -> Void) {

NextcloudKit.shared.nkCommonInstance.writeLog("[DEBUG] Start handle Events For Background URLSession: \(identifier)")
WidgetCenter.shared.reloadAllTimelines()
backgroundSessionCompletionHandler = completionHandler
Expand All @@ -288,7 +287,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
}

func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {

if let pref = UserDefaults(suiteName: NCBrandOptions.shared.capabilitiesGroups),
let data = pref.object(forKey: "NOTIFICATION_DATA") as? [String: AnyObject] {
nextcloudPushNotificationAction(data: data)
Expand Down Expand Up @@ -369,13 +367,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
if NCBrandOptions.shared.use_AppConfig {
if activeLogin?.view.window == nil {
urlBase = NCBrandOptions.shared.loginBaseUrl

NextcloudKit.shared.getLoginFlowV2(serverUrl: urlBase) { token, endpoint, login, _, error in

// Login Flow V2
if error == .success, let token, let endpoint, let login {
let vc = UIHostingController(rootView: NCLoginPoll(loginFlowV2Token: token, loginFlowV2Endpoint: endpoint, loginFlowV2Login: login, cancelButtonDisabled: NCManageDatabase.shared.getAccounts().isEmptyOrNil))

UIApplication.shared.firstWindow?.rootViewController?.present(vc, animated: true)
}
}
Expand All @@ -388,7 +383,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
if selector == NCGlobal.shared.introSignup {
if activeLogin?.view.window == nil {
activeLogin = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin

if selector == NCGlobal.shared.introSignup {
activeLogin?.urlBase = NCBrandOptions.shared.linkloginPreferredProviders
let web = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLoginProvider") as? NCLoginProvider
Expand Down Expand Up @@ -440,13 +434,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
}

func trustCertificateError(host: String) {

guard let currentHost = URL(string: self.urlBase)?.host,
let pushNotificationServerProxyHost = URL(string: NCBrandOptions.shared.pushNotificationServerProxy)?.host,
host != pushNotificationServerProxyHost,
host == currentHost
else { return }

let certificateHostSavedPath = NCUtilityFileSystem().directoryCertificates + "/" + host + ".der"
var title = NSLocalizedString("_ssl_certificate_changed_", comment: "")

Expand Down Expand Up @@ -505,7 +497,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
}

func changeAccount(_ account: String, userProfile: NKUserProfile?) {

NCNetworking.shared.cancelAllQueue()
NCNetworking.shared.cancelDataTask()
NCNetworking.shared.cancelDownloadTasks()
Expand Down Expand Up @@ -596,9 +587,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD

func updateShareAccounts() -> Error? {
guard let dirGroupApps = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroupApps) else { return nil }

let tableAccount = NCManageDatabase.shared.getAllAccount()
var accounts = [NKShareAccounts.DataAccounts]()

for account in tableAccount {
let name = account.alias.isEmpty ? account.displayName : account.alias
let userBaseUrl = account.user + "-" + (URL(string: account.urlBase)?.host ?? "")
Expand Down
15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/address.imageset/Contents.json

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/businesstype.imageset/Contents.json

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions iOSClient/Images.xcassets/caldavcardav.imageset/Contents.json

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/capabilities.imageset/Contents.json

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/checkmark.imageset/Contents.json

This file was deleted.

1 change: 0 additions & 1 deletion iOSClient/Images.xcassets/checkmark.imageset/check.svg

This file was deleted.

15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/city.imageset/Contents.json

This file was deleted.

Binary file removed iOSClient/Images.xcassets/city.imageset/city.pdf
Binary file not shown.
15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/clear.imageset/Contents.json

This file was deleted.

Binary file removed iOSClient/Images.xcassets/clear.imageset/clear.pdf
Binary file not shown.
15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/comment.imageset/Contents.json

This file was deleted.

Binary file removed iOSClient/Images.xcassets/comment.imageset/comment.pdf
Binary file not shown.
15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/comments.imageset/Contents.json

This file was deleted.

Binary file not shown.
15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/company.imageset/Contents.json

This file was deleted.

Binary file removed iOSClient/Images.xcassets/company.imageset/company.pdf
Binary file not shown.
15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/country.imageset/Contents.json

This file was deleted.

Binary file not shown.
15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/crashservice.imageset/Contents.json

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/editUserProfile.imageset/Contents.json

This file was deleted.

Binary file not shown.
15 changes: 0 additions & 15 deletions iOSClient/Images.xcassets/log.imageset/Contents.json

This file was deleted.

Binary file removed iOSClient/Images.xcassets/log.imageset/log.pdf
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 755e07d

Please sign in to comment.