This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from amiantos/ios12
Updates for iOS 12
- Loading branch information
Showing
114 changed files
with
3,887 additions
and
1,765 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
disabled_rules: | ||
- trailing_whitespace | ||
- force_cast | ||
opt_in_rules: | ||
- empty_count | ||
- empty_string | ||
excluded: | ||
- Carthage | ||
- Pods | ||
- SwiftLint/Common/3rdPartyLib | ||
line_length: | ||
warning: 150 | ||
error: 200 | ||
ignores_function_declarations: true | ||
ignores_comments: true | ||
ignores_urls: true | ||
function_body_length: | ||
warning: 300 | ||
error: 500 | ||
function_parameter_count: | ||
warning: 6 | ||
error: 8 | ||
type_body_length: | ||
warning: 300 | ||
error: 500 | ||
file_length: | ||
warning: 1000 | ||
error: 1500 | ||
ignore_comment_only_lines: true | ||
cyclomatic_complexity: | ||
warning: 15 | ||
error: 25 | ||
reporter: "xcode" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
language: objective-c | ||
osx_image: xcode9.3 | ||
osx_image: xcode10 | ||
|
||
before_install: | ||
- pod repo update | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
// | ||
// AppDelegate.swift | ||
// Numu Tracker | ||
// | ||
// Created by Bradley Root on 9/11/16. | ||
// Copyright © 2016 Numu Tracker. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import PusherSwift | ||
import UserNotifications | ||
import SwiftyJSON | ||
import Fabric | ||
import Crashlytics | ||
import CloudKit | ||
|
||
@UIApplicationMain | ||
class AppDelegate: UIResponder, UIApplicationDelegate { | ||
|
||
var window: UIWindow? | ||
|
||
// Production | ||
let pusher = Pusher(key: "") | ||
|
||
// Development | ||
//let pusher = Pusher(key: "") | ||
|
||
func application( | ||
_ application: UIApplication, | ||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | ||
|
||
Fabric.with([Crashlytics.self]) | ||
|
||
NumuReviewHelper.incrementActivityCount() | ||
|
||
NotificationCenter.default.addObserver( | ||
self, selector: #selector(self.runLogInOperations), name: .LoggedOut, object: nil) | ||
|
||
NotificationCenter.default.addObserver( | ||
self, selector: #selector(self.ckDataChange), name: Notification.Name.CKAccountChanged, object: nil) | ||
|
||
runLogInOperations() | ||
|
||
return true | ||
} | ||
|
||
@objc func ckDataChange() { | ||
// Need to re-run authorization procedure here. | ||
runLogInOperations() | ||
} | ||
|
||
deinit { | ||
NotificationCenter.default.removeObserver(self) | ||
} | ||
|
||
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { | ||
pusher.nativePusher.register(deviceToken: deviceToken) | ||
if let username = NumuCredential.shared.getUsername() { | ||
if defaults.newReleased { | ||
pusher.nativePusher.subscribe(interestName: "newReleased_" + username) | ||
print("Turned on new notifications") | ||
} else { | ||
pusher.nativePusher.unsubscribe(interestName: "newReleased_" + username) | ||
print("Turned off new notifications") | ||
} | ||
|
||
if defaults.newAnnouncements { | ||
pusher.nativePusher.subscribe(interestName: "newAnnouncements_" + username) | ||
print("Turned on new music friday notifications") | ||
} else { | ||
pusher.nativePusher.unsubscribe(interestName: "newAnnouncements_" + username) | ||
print("Turned off new music friday notifications") | ||
} | ||
|
||
if defaults.moreReleases { | ||
pusher.nativePusher.subscribe(interestName: "moreReleases_" + username) | ||
print("Turned on more releases notifications") | ||
} else { | ||
pusher.nativePusher.unsubscribe(interestName: "moreReleases_" + username) | ||
print("Turned off more releases notifications") | ||
} | ||
} | ||
} | ||
|
||
@objc fileprivate func runLogInOperations() { | ||
let queue = OperationQueue() | ||
|
||
// Get and store CK record ID if available | ||
let getCKUserOperation = GetCKUserOperation() | ||
// If user account exists already, link it to CK or create new account | ||
let registerWithCKOperation = RegisterWithCKOperation() | ||
// Try to auth with any credentials | ||
let authOperation = AuthOperation() | ||
|
||
registerWithCKOperation.addDependency(getCKUserOperation) | ||
authOperation.addDependency(registerWithCKOperation) | ||
authOperation.completionBlock = { | ||
print("Finished Auth Process!!!") | ||
DispatchQueue.main.async(execute: { | ||
if defaults.logged { | ||
UIApplication.shared.registerForRemoteNotifications() | ||
} | ||
}) | ||
} | ||
queue.addOperations([getCKUserOperation, registerWithCKOperation, authOperation], waitUntilFinished: false) | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.