Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

iOS console : removed no more used pod, solved Xcode warnings

William Balcaen1796b6fd8101
diff --git a/console/iOS/console/AppDelegate.swift b/console/iOS/console/AppDelegate.swift
index 417ad6ab1..1690ec6cc 100644
--- a/console/iOS/console/AppDelegate.swift
+++ b/console/iOS/console/AppDelegate.swift
@@ -7,7 +7,6 @@
//
import UIKit
-import AppAuth
import UserNotifications
import Firebase
@@ -16,7 +15,6 @@ import Firebase
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {
var window: UIWindow?
- var currentAuthorizationFlow : OIDAuthorizationFlowSession?
let gcmMessageIDKey = "gcm.message_id"
var reachabilityAlert : UIAlertController?
var reachabilityAlertShown = false
@@ -134,11 +132,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
- if (self.currentAuthorizationFlow?.resumeAuthorizationFlow(with: url))! {
- self.currentAuthorizationFlow = nil
return true
- }
- return false
}
diff --git a/console/iOS/console/ORViewController.swift b/console/iOS/console/ORViewController.swift
index f1cdf5df8..13ad92417 100644
--- a/console/iOS/console/ORViewController.swift
+++ b/console/iOS/console/ORViewController.swift
@@ -91,7 +91,7 @@ class ORViewcontroller : UIViewController, URLSessionDelegate, WKScriptMessageHa
let reqDataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) in
DispatchQueue.main.async {
if (error != nil) {
- NSLog("error %@", (error as! NSError).localizedDescription)
+ NSLog("error %@", (error! as NSError).localizedDescription)
let error = NSError(domain: "", code: 0, userInfo: [
NSLocalizedDescriptionKey : NSLocalizedString("ErrorCallingAPI", value: "Could not get data", comment: "")
])
@@ -191,7 +191,7 @@ class ORViewcontroller : UIViewController, URLSessionDelegate, WKScriptMessageHa
let reqDataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) in
DispatchQueue.main.async {
if (error != nil) {
- NSLog("error %@", (error as! NSError).localizedDescription)
+ NSLog("error %@", (error! as NSError).localizedDescription)
let error = NSError(domain: "", code: 0, userInfo: [
NSLocalizedDescriptionKey : NSLocalizedString("ErrorCallingAPI", value: "Could not get data", comment: "")
])
diff --git a/console/iOS/console/TokenManager.swift b/console/iOS/console/TokenManager.swift
index dfa4776f2..a3ab4f703 100644
--- a/console/iOS/console/TokenManager.swift
+++ b/console/iOS/console/TokenManager.swift
@@ -179,6 +179,7 @@ class TokenManager:NSObject, WKScriptMessageHandler, WKUIDelegate, WKNavigationD
}
func sendDeviceId() {
+ print("Device Id : -------------> ",deviceId ?? "")
self.getAccessToken { (accessTokenResult) in
switch accessTokenResult {
case .Failure(let error) :
@@ -196,7 +197,7 @@ class TokenManager:NSObject, WKScriptMessageHandler, WKUIDelegate, WKNavigationD
let reqDataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) in
DispatchQueue.main.async {
if (error != nil) {
- NSLog("error %@", (error as! NSError).localizedDescription)
+ NSLog("error %@", (error! as NSError).localizedDescription)
let error = NSError(domain: "", code: 0, userInfo: [
NSLocalizedDescriptionKey : NSLocalizedString("ErrorCallingAPI", value: "Could not get data", comment: "")
])
@@ -262,7 +263,7 @@ class TokenManager:NSObject, WKScriptMessageHandler, WKUIDelegate, WKNavigationD
callback(AccesTokenResult.Failure(error))
} else {
if (error != nil) {
- NSLog("error %@", (error as! NSError).localizedDescription as String)
+ NSLog("error %@", (error! as NSError).localizedDescription as String)
}
let error = NSError(domain: "", code: 0, userInfo: [
NSLocalizedDescriptionKey : NSLocalizedString("ErrorCallingAPI", value: "Could not get data", comment: "")
@@ -279,7 +280,7 @@ class TokenManager:NSObject, WKScriptMessageHandler, WKUIDelegate, WKNavigationD
callback(AccesTokenResult.Failure(error))
}
} else {
- NSLog("error %@", (error as! NSError).localizedDescription)
+ NSLog("error %@", (error! as NSError).localizedDescription)
let error = NSError(domain: "", code: 0, userInfo: [
NSLocalizedDescriptionKey : NSLocalizedString("NoDataReceived", value: "Did not receive any data", comment: "")
])
diff --git a/console/iOS/console/ViewController.swift b/console/iOS/console/ViewController.swift
index 019d7dc89..9616c8932 100644
--- a/console/iOS/console/ViewController.swift
+++ b/console/iOS/console/ViewController.swift
@@ -7,10 +7,8 @@
//
import UIKit
-import AppAuth
class ViewController: UIViewController {
- var authState : OIDAuthState?
var isInError : Bool = false
let loginButton = UIButton(type: .roundedRect)
let orViewController = ORViewcontroller()
diff --git a/console/iOS/podfile b/console/iOS/podfile
index 9772321f9..da37debdf 100644
--- a/console/iOS/podfile
+++ b/console/iOS/podfile
@@ -1,6 +1,5 @@
target 'console' do
use_frameworks!
-pod 'AppAuth'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
end