diff --git a/Podfile b/Podfile index f23858f..8ceed01 100644 --- a/Podfile +++ b/Podfile @@ -1,8 +1,13 @@ -project 'TelenorConnectIosHelloWorld.xcodeproj' -platform :ios, '8.0' -use_frameworks! +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' target 'TelenorConnectIosHelloWorld' do - pod 'AeroGearHttp', :git => 'https://github.com/aerogear/aerogear-ios-http' - pod 'TDConnectIosSdk', :git => 'https://github.com/telenordigital/connect-ios-sdk' -end \ No newline at end of file + # Comment this line if you're not using Swift and don't want to use dynamic frameworks + use_frameworks! + + # Pods for TelenorConnectIosHelloWorld + pod 'AeroGearHttp', :git => 'https://github.com/aerogear/aerogear-ios-http' + pod 'TDConnectIosSdk', :git => 'https://github.com/telenordigital/connect-ios-sdk' + +end + \ No newline at end of file diff --git a/Podfile.lock b/Podfile.lock index 1a42093..412464f 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,9 +1,9 @@ PODS: - - AeroGearHttp (0.5.1) + - AeroGearHttp (0.6.0) - CryptoSwift (0.4.1) - JSONWebToken (1.5.0): - CryptoSwift (~> 0.4.0) - - TDConnectIosSdk (0.6.6): + - TDConnectIosSdk (0.6.7): - AeroGearHttp - JSONWebToken @@ -19,18 +19,18 @@ EXTERNAL SOURCES: CHECKOUT OPTIONS: AeroGearHttp: - :commit: 20e954caa168ed8605ae05322fbfaf038fd79366 + :commit: 2a8ec606689c6393b9d1288628f70540146f4ade :git: https://github.com/aerogear/aerogear-ios-http TDConnectIosSdk: - :commit: 1c3306be0887555a2ebe4820b01f42aad026619c + :commit: c516ff01b1e08b5e670cf98710eb8a0f17e1f29f :git: https://github.com/telenordigital/connect-ios-sdk SPEC CHECKSUMS: - AeroGearHttp: 9eb405b694aa9ac5daff842f68648f4a9fe0fa66 + AeroGearHttp: e958f301cc2d1c7fbfd4b61af187ea3490040a48 CryptoSwift: 25b5aff3f260967391f8fff2e9abe4254d2c6fd5 JSONWebToken: 6c8968ace6b60b2e6156a7bbe5019fd9b5ff9b5a - TDConnectIosSdk: d0503de4b846e2579a3e2b43ce59570031d14165 + TDConnectIosSdk: 904a8dfa63a3d936daf56e2924bc464db426839c -PODFILE CHECKSUM: 1c96fe7691aaf078d7cdde56220fd023769a51ba +PODFILE CHECKSUM: b4ee71a4f6c6fbc8db28daac12b4c8438ff1e5bc COCOAPODS: 1.0.1 diff --git a/Pods/AeroGearHttp/AeroGearHttp/Http.swift b/Pods/AeroGearHttp/AeroGearHttp/Http.swift index 6fc7867..a6cd355 100644 --- a/Pods/AeroGearHttp/AeroGearHttp/Http.swift +++ b/Pods/AeroGearHttp/AeroGearHttp/Http.swift @@ -132,13 +132,16 @@ public class Http { var request: NSURLRequest var task: NSURLSessionTask? var delegate: TaskDataDelegate + // Merge headers + let headers = merge(self.requestSerializer.headers, self.authzModule?.authorizationFields()) + // care for multipart request is multipart data are set if (self.hasMultiPartData(parameters)) { - request = self.requestSerializer.multipartRequest(finalURL, method: method, parameters: parameters, headers: self.authzModule?.authorizationFields()) + request = self.requestSerializer.multipartRequest(finalURL, method: method, parameters: parameters, headers: headers) task = self.session.uploadTaskWithStreamedRequest(request) delegate = TaskUploadDelegate() } else { - request = self.requestSerializer.request(finalURL, method: method, parameters: parameters, headers: self.authzModule?.authorizationFields()) + request = self.requestSerializer.request(finalURL, method: method, parameters: parameters, headers: headers) task = self.session.dataTaskWithRequest(request); delegate = TaskDataDelegate() } @@ -188,11 +191,14 @@ public class Http { return } var request: NSURLRequest + // Merge headers + let headers = merge(self.requestSerializer.headers, self.authzModule?.authorizationFields()) + // care for multipart request is multipart data are set if (self.hasMultiPartData(parameters)) { - request = self.requestSerializer.multipartRequest(finalURL, method: method, parameters: parameters, headers: self.authzModule?.authorizationFields()) + request = self.requestSerializer.multipartRequest(finalURL, method: method, parameters: parameters, headers: headers) } else { - request = self.requestSerializer.request(finalURL, method: method, parameters: parameters, headers: self.authzModule?.authorizationFields()) + request = self.requestSerializer.request(finalURL, method: method, parameters: parameters, headers: headers) } var task: NSURLSessionTask? diff --git a/Pods/AeroGearHttp/AeroGearHttp/Utils.swift b/Pods/AeroGearHttp/AeroGearHttp/Utils.swift index 1f55a14..cc41886 100644 --- a/Pods/AeroGearHttp/AeroGearHttp/Utils.swift +++ b/Pods/AeroGearHttp/AeroGearHttp/Utils.swift @@ -31,3 +31,19 @@ extension String { return encodedURL as String } } + +public func merge(one: [String: String]?, _ two: [String:String]?) -> [String: String]? { + var dict: [String: String]? + if let one = one { + dict = one + if let two = two { + for (key, value) in two { + dict![key] = value + } + } + } else { + dict = two + } + return dict +} + diff --git a/Pods/Local Podspecs/AeroGearHttp.podspec.json b/Pods/Local Podspecs/AeroGearHttp.podspec.json index af41366..ed5da52 100644 --- a/Pods/Local Podspecs/AeroGearHttp.podspec.json +++ b/Pods/Local Podspecs/AeroGearHttp.podspec.json @@ -1,13 +1,13 @@ { "name": "AeroGearHttp", - "version": "0.5.1", + "version": "0.6.0", "summary": "Lightweight lib around NSURLSession to ease HTTP calls.", "homepage": "https://github.com/aerogear/aerogear-ios-http", "license": "Apache License, Version 2.0", "authors": "Red Hat, Inc.", "source": { "git": "https://github.com/aerogear/aerogear-ios-http.git", - "tag": "0.5.1" + "tag": "0.6.0" }, "platforms": { "ios": "8.0" diff --git a/Pods/Local Podspecs/TDConnectIosSdk.podspec.json b/Pods/Local Podspecs/TDConnectIosSdk.podspec.json index d102111..637dfb9 100644 --- a/Pods/Local Podspecs/TDConnectIosSdk.podspec.json +++ b/Pods/Local Podspecs/TDConnectIosSdk.podspec.json @@ -1,13 +1,13 @@ { "name": "TDConnectIosSdk", - "version": "0.6.6", + "version": "0.6.7", "summary": "OAuth2 client library based on aerogear-ios-http", "homepage": "https://github.com/telenordigital/aerogear-ios-oauth2", "license": "Apache License, Version 2.0", "authors": "Telenor Digital", "source": { "git": "https://github.com/telenordigital/aerogear-ios-oauth2.git", - "tag": "0.6.6" + "tag": "0.6.7" }, "platforms": { "ios": "8.0" diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 1a42093..412464f 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -1,9 +1,9 @@ PODS: - - AeroGearHttp (0.5.1) + - AeroGearHttp (0.6.0) - CryptoSwift (0.4.1) - JSONWebToken (1.5.0): - CryptoSwift (~> 0.4.0) - - TDConnectIosSdk (0.6.6): + - TDConnectIosSdk (0.6.7): - AeroGearHttp - JSONWebToken @@ -19,18 +19,18 @@ EXTERNAL SOURCES: CHECKOUT OPTIONS: AeroGearHttp: - :commit: 20e954caa168ed8605ae05322fbfaf038fd79366 + :commit: 2a8ec606689c6393b9d1288628f70540146f4ade :git: https://github.com/aerogear/aerogear-ios-http TDConnectIosSdk: - :commit: 1c3306be0887555a2ebe4820b01f42aad026619c + :commit: c516ff01b1e08b5e670cf98710eb8a0f17e1f29f :git: https://github.com/telenordigital/connect-ios-sdk SPEC CHECKSUMS: - AeroGearHttp: 9eb405b694aa9ac5daff842f68648f4a9fe0fa66 + AeroGearHttp: e958f301cc2d1c7fbfd4b61af187ea3490040a48 CryptoSwift: 25b5aff3f260967391f8fff2e9abe4254d2c6fd5 JSONWebToken: 6c8968ace6b60b2e6156a7bbe5019fd9b5ff9b5a - TDConnectIosSdk: d0503de4b846e2579a3e2b43ce59570031d14165 + TDConnectIosSdk: 904a8dfa63a3d936daf56e2924bc464db426839c -PODFILE CHECKSUM: 1c96fe7691aaf078d7cdde56220fd023769a51ba +PODFILE CHECKSUM: b4ee71a4f6c6fbc8db28daac12b4c8438ff1e5bc COCOAPODS: 1.0.1 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 6dbe828..ed8ed0a 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -933,47 +933,38 @@ /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ - 47BEF9D903506B003EA5C2B249729489 /* Debug */ = { + 51508AA41A0B5C066A23365D99759A48 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = E9290EF632A051C9102E7CE8A99BA603 /* Pods-TelenorConnectIosHelloWorld.release.xcconfig */; buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_DEBUG=1", - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - ONLY_ACTIVE_ARCH = YES; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_NO_COMMON_BLOCKS = YES; + INFOPLIST_FILE = "Target Support Files/Pods-TelenorConnectIosHelloWorld/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-TelenorConnectIosHelloWorld/Pods-TelenorConnectIosHelloWorld.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_TelenorConnectIosHelloWorld; + SDKROOT = iphoneos; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; 6DBC9DEE986B8DAFE7B8FDC0944803A3 /* Release */ = { isa = XCBuildConfiguration; @@ -1004,6 +995,44 @@ }; name = Release; }; + 6FD823741523B6BBA156FD2A31130E50 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + ENABLE_NS_ASSERTIONS = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_RELEASE=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; 76CDC8F6D238B22BE6F9D44E079B8B31 /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = 206FA684087985C6B0FF5193196D760C /* CryptoSwift.xcconfig */; @@ -1063,9 +1092,9 @@ }; name = Release; }; - A23AB96EA01841BA9DE32653266145F5 /* Debug */ = { + 925BFBF8ED1B546548B9A295803BAFC2 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 1FD3437ECAE2472C0CB1180E724FED85 /* TDConnectIosSdk.xcconfig */; + baseConfigurationReference = 846956F595C3663BC7BCA73E2E5E1931 /* Pods-TelenorConnectIosHelloWorld.debug.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; @@ -1076,14 +1105,18 @@ DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/TDConnectIosSdk/TDConnectIosSdk-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/TDConnectIosSdk/Info.plist"; + INFOPLIST_FILE = "Target Support Files/Pods-TelenorConnectIosHelloWorld/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/TDConnectIosSdk/TDConnectIosSdk.modulemap"; + MACH_O_TYPE = staticlib; + MODULEMAP_FILE = "Target Support Files/Pods-TelenorConnectIosHelloWorld/Pods-TelenorConnectIosHelloWorld.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; - PRODUCT_NAME = TDConnectIosSdk; + OTHER_LDFLAGS = ""; + OTHER_LIBTOOLFLAGS = ""; + PODS_ROOT = "$(SRCROOT)"; + PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; + PRODUCT_NAME = Pods_TelenorConnectIosHelloWorld; SDKROOT = iphoneos; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -1093,106 +1126,64 @@ }; name = Debug; }; - AAF678CED40D3499169D10F63CA0719E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - ENABLE_NS_ASSERTIONS = NO; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_PREPROCESSOR_DEFINITIONS = ( - "POD_CONFIGURATION_RELEASE=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - STRIP_INSTALLED_PRODUCT = NO; - SYMROOT = "${SRCROOT}/../build"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - C8F24A56F9E1AD1E2DA11349F596E991 /* Release */ = { + A23AB96EA01841BA9DE32653266145F5 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AE49CD29256305E235AB30D97A4D2590 /* AeroGearHttp.xcconfig */; + baseConfigurationReference = 1FD3437ECAE2472C0CB1180E724FED85 /* TDConnectIosSdk.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEBUG_INFORMATION_FORMAT = dwarf; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREFIX_HEADER = "Target Support Files/AeroGearHttp/AeroGearHttp-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/AeroGearHttp/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/TDConnectIosSdk/TDConnectIosSdk-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/TDConnectIosSdk/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MODULEMAP_FILE = "Target Support Files/AeroGearHttp/AeroGearHttp.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - PRODUCT_NAME = AeroGearHttp; + MODULEMAP_FILE = "Target Support Files/TDConnectIosSdk/TDConnectIosSdk.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + PRODUCT_NAME = TDConnectIosSdk; SDKROOT = iphoneos; SKIP_INSTALL = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Release; + name = Debug; }; - DA3DA9C1458DAC84BD27EE75F724CB63 /* Debug */ = { + C8F24A56F9E1AD1E2DA11349F596E991 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 846956F595C3663BC7BCA73E2E5E1931 /* Pods-TelenorConnectIosHelloWorld.debug.xcconfig */; + baseConfigurationReference = AE49CD29256305E235AB30D97A4D2590 /* AeroGearHttp.xcconfig */; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-TelenorConnectIosHelloWorld/Info.plist"; + GCC_PREFIX_HEADER = "Target Support Files/AeroGearHttp/AeroGearHttp-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/AeroGearHttp/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-TelenorConnectIosHelloWorld/Pods-TelenorConnectIosHelloWorld.modulemap"; - MTL_ENABLE_DEBUG_INFO = YES; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_TelenorConnectIosHelloWorld; + MODULEMAP_FILE = "Target Support Files/AeroGearHttp/AeroGearHttp.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_NAME = AeroGearHttp; SDKROOT = iphoneos; SKIP_INSTALL = YES; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; - name = Debug; + name = Release; }; DA7DA52B70856B64F7DF02127253FD3A /* Debug */ = { isa = XCBuildConfiguration; @@ -1254,38 +1245,47 @@ }; name = Debug; }; - E99DA77B3AFCC45975ACDA2BECAC40BC /* Release */ = { + EE3433E81723238FDF523A9838FEC7BD /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E9290EF632A051C9102E7CE8A99BA603 /* Pods-TelenorConnectIosHelloWorld.release.xcconfig */; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - CURRENT_PROJECT_VERSION = 1; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_NO_COMMON_BLOCKS = YES; - INFOPLIST_FILE = "Target Support Files/Pods-TelenorConnectIosHelloWorld/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MACH_O_TYPE = staticlib; - MODULEMAP_FILE = "Target Support Files/Pods-TelenorConnectIosHelloWorld/Pods-TelenorConnectIosHelloWorld.modulemap"; - MTL_ENABLE_DEBUG_INFO = NO; - OTHER_LDFLAGS = ""; - OTHER_LIBTOOLFLAGS = ""; - PODS_ROOT = "$(SRCROOT)"; - PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = Pods_TelenorConnectIosHelloWorld; - SDKROOT = iphoneos; - SKIP_INSTALL = YES; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "POD_CONFIGURATION_DEBUG=1", + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; + ONLY_ACTIVE_ARCH = YES; + STRIP_INSTALLED_PRODUCT = NO; + SYMROOT = "${SRCROOT}/../build"; }; - name = Release; + name = Debug; }; FF10D6DF652DC5AC8411A172A516C615 /* Release */ = { isa = XCBuildConfiguration; @@ -1331,8 +1331,8 @@ 2D8E8EC45A3A1A1D94AE762CB5028504 /* Build configuration list for PBXProject "Pods" */ = { isa = XCConfigurationList; buildConfigurations = ( - 47BEF9D903506B003EA5C2B249729489 /* Debug */, - AAF678CED40D3499169D10F63CA0719E /* Release */, + EE3433E81723238FDF523A9838FEC7BD /* Debug */, + 6FD823741523B6BBA156FD2A31130E50 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1340,8 +1340,8 @@ 68EDC593B4F9A0F96D53968E11963ADF /* Build configuration list for PBXNativeTarget "Pods-TelenorConnectIosHelloWorld" */ = { isa = XCConfigurationList; buildConfigurations = ( - DA3DA9C1458DAC84BD27EE75F724CB63 /* Debug */, - E99DA77B3AFCC45975ACDA2BECAC40BC /* Release */, + 925BFBF8ED1B546548B9A295803BAFC2 /* Debug */, + 51508AA41A0B5C066A23365D99759A48 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Pods/TDConnectIosSdk/TDConnectIosSdk/OAuth2Module.swift b/Pods/TDConnectIosSdk/TDConnectIosSdk/OAuth2Module.swift index 7563fdc..bc775a4 100644 --- a/Pods/TDConnectIosSdk/TDConnectIosSdk/OAuth2Module.swift +++ b/Pods/TDConnectIosSdk/TDConnectIosSdk/OAuth2Module.swift @@ -99,10 +99,27 @@ public class OAuth2Module: AuthzModule { // external browser, and the oauth code is available so that we can then proceed to request the 'access_token' // from the server. applicationLaunchNotificationObserver = NSNotificationCenter.defaultCenter().addObserverForName(AGAppLaunchedWithURLNotification, object: nil, queue: nil, usingBlock: { (notification: NSNotification!) -> Void in - self.extractCode(notification, completionHandler: completionHandler) - if self.config.isWebView { - UIApplication.sharedApplication().keyWindow?.rootViewController?.dismissViewControllerAnimated(true, completion: nil) - } + self.extractCode(notification, completionHandler: { (accessToken: AnyObject?, error: NSError?) in + guard let accessToken = accessToken else { + if self.config.isWebView { + UIApplication.sharedApplication().keyWindow?.rootViewController?.dismissViewControllerAnimated(true, completion: { + completionHandler(nil, error) + }) + } else { + completionHandler(nil, error) + } + return + } + + if self.config.isWebView { + UIApplication.sharedApplication().keyWindow?.rootViewController?.dismissViewControllerAnimated(true, completion: { + completionHandler(accessToken, nil) + }) + } else { + completionHandler(accessToken, nil) + } + }) + }) // register to receive notification when the application becomes active so we diff --git a/Pods/TDConnectIosSdk/TDConnectIosSdk/TrustedPersistantOAuth2Session.swift b/Pods/TDConnectIosSdk/TDConnectIosSdk/TrustedPersistantOAuth2Session.swift index 0615166..190ee0c 100644 --- a/Pods/TDConnectIosSdk/TDConnectIosSdk/TrustedPersistantOAuth2Session.swift +++ b/Pods/TDConnectIosSdk/TDConnectIosSdk/TrustedPersistantOAuth2Session.swift @@ -86,27 +86,24 @@ public class KeychainWrap { keychainQuery[kSecClass as String] = kSecClassGenericPassword keychainQuery[kSecAttrService as String] = self.serviceIdentifier keychainQuery[kSecAttrAccount as String] = key + "_" + tokenType.rawValue - keychainQuery[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly // Search for the keychain items let statusSearch: OSStatus = SecItemCopyMatching(keychainQuery, nil) // if found update if (statusSearch == errSecSuccess) { - if (dataFromString != nil) { - let attributesToUpdate = NSMutableDictionary() - attributesToUpdate[kSecValueData as String] = dataFromString! + let attributesToUpdate = NSMutableDictionary() + attributesToUpdate[kSecValueData as String] = dataFromString! + attributesToUpdate[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly - let statusUpdate: OSStatus = SecItemUpdate(keychainQuery, attributesToUpdate) - if (statusUpdate != errSecSuccess) { - print("tokens not updated") - return false - } - } else { // revoked token or newly installed app, clear KC - return self.resetKeychain() + let statusUpdate: OSStatus = SecItemUpdate(keychainQuery, attributesToUpdate) + if (statusUpdate != errSecSuccess) { + print("tokens not updated") + return false } } else if(statusSearch == errSecItemNotFound) { // if new, add keychainQuery[kSecValueData as String] = dataFromString! + keychainQuery[kSecAttrAccessible as String] = kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly let statusAdd: OSStatus = SecItemAdd(keychainQuery, nil) if(statusAdd != errSecSuccess) { print("tokens not saved") diff --git a/Pods/Target Support Files/AeroGearHttp/Info.plist b/Pods/Target Support Files/AeroGearHttp/Info.plist index 1c2e79e..89a577b 100644 --- a/Pods/Target Support Files/AeroGearHttp/Info.plist +++ b/Pods/Target Support Files/AeroGearHttp/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.5.1 + 0.6.0 CFBundleSignature ???? CFBundleVersion diff --git a/Pods/Target Support Files/TDConnectIosSdk/Info.plist b/Pods/Target Support Files/TDConnectIosSdk/Info.plist index bcebace..2ed4c69 100644 --- a/Pods/Target Support Files/TDConnectIosSdk/Info.plist +++ b/Pods/Target Support Files/TDConnectIosSdk/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 0.6.6 + 0.6.7 CFBundleSignature ???? CFBundleVersion diff --git a/TelenorConnectIosHelloWorld.xcodeproj/project.pbxproj b/TelenorConnectIosHelloWorld.xcodeproj/project.pbxproj index fb5b1bc..7b21383 100644 --- a/TelenorConnectIosHelloWorld.xcodeproj/project.pbxproj +++ b/TelenorConnectIosHelloWorld.xcodeproj/project.pbxproj @@ -13,8 +13,7 @@ 5C6D57091C91B2FF001A564E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5C6D57081C91B2FF001A564E /* Assets.xcassets */; }; 5C6D570C1C91B2FF001A564E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5C6D570A1C91B2FF001A564E /* LaunchScreen.storyboard */; }; 5C6D57141C92E896001A564E /* SignedInViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5C6D57131C92E896001A564E /* SignedInViewController.swift */; }; - 7DC218B0E52709CCBC114DC0 /* Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7296F44B3C2C4940BF20C6E5 /* Pods.framework */; }; - E75703217DD52B571AFBB810 /* Pods_TelenorConnectIosHelloWorld.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D809B7315DF15820086C1AF3 /* Pods_TelenorConnectIosHelloWorld.framework */; }; + E75703217DD52B571AFBB810 /* Pods_TelenorConnectIosHelloWorld.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D809B7315DF15820086C1AF3 /* Pods_TelenorConnectIosHelloWorld.framework */; settings = {ATTRIBUTES = (Required, ); }; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -39,7 +38,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 7DC218B0E52709CCBC114DC0 /* Pods.framework in Frameworks */, E75703217DD52B571AFBB810 /* Pods_TelenorConnectIosHelloWorld.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -134,6 +132,7 @@ TargetAttributes = { 5C6D56FD1C91B2FF001A564E = { CreatedOnToolsVersion = 7.2.1; + DevelopmentTeam = M4Q75B4WS4; }; }; }; @@ -340,6 +339,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = TelenorConnectIosHelloWorld/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.telenor.connect.TelenorConnectIosHelloWorld; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -355,6 +355,7 @@ CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = TelenorConnectIosHelloWorld/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.4; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.telenor.connect.TelenorConnectIosHelloWorld; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/TelenorConnectIosHelloWorld.xcworkspace/xcshareddata/TelenorConnectIosHelloWorld.xcscmblueprint b/TelenorConnectIosHelloWorld.xcworkspace/xcshareddata/TelenorConnectIosHelloWorld.xcscmblueprint deleted file mode 100644 index 485441a..0000000 --- a/TelenorConnectIosHelloWorld.xcworkspace/xcshareddata/TelenorConnectIosHelloWorld.xcscmblueprint +++ /dev/null @@ -1,30 +0,0 @@ -{ - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "7B8E9154342FC2291D5B47B1E0FD95030549A044", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { - - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { - "0C8AF9E7E5AFF561C6C4CF85A7C8ACC3A853551C" : 0, - "7B8E9154342FC2291D5B47B1E0FD95030549A044" : 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "7E5ED00F-8DFF-411B-8D1B-E829C42D2E3D", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { - "0C8AF9E7E5AFF561C6C4CF85A7C8ACC3A853551C" : "td-aerogear-ios-oauth2\/", - "7B8E9154342FC2291D5B47B1E0FD95030549A044" : "TelenorConnectIosHelloWorld\/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey" : "TelenorConnectIosHelloWorld", - "DVTSourceControlWorkspaceBlueprintVersion" : 204, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "TelenorConnectIosHelloWorld.xcworkspace", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:telenordigital\/aerogear-ios-oauth2.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "0C8AF9E7E5AFF561C6C4CF85A7C8ACC3A853551C" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/telenordigital\/TelenorConnectIosHelloWorld.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "7B8E9154342FC2291D5B47B1E0FD95030549A044" - } - ] -} \ No newline at end of file diff --git a/TelenorConnectIosHelloWorld/Base.lproj/LaunchScreen.storyboard b/TelenorConnectIosHelloWorld/Base.lproj/LaunchScreen.storyboard index 323bd43..ebf48f6 100644 --- a/TelenorConnectIosHelloWorld/Base.lproj/LaunchScreen.storyboard +++ b/TelenorConnectIosHelloWorld/Base.lproj/LaunchScreen.storyboard @@ -1,5 +1,5 @@ - + diff --git a/TelenorConnectIosHelloWorld/Base.lproj/Main.storyboard b/TelenorConnectIosHelloWorld/Base.lproj/Main.storyboard index febd30c..654b719 100644 --- a/TelenorConnectIosHelloWorld/Base.lproj/Main.storyboard +++ b/TelenorConnectIosHelloWorld/Base.lproj/Main.storyboard @@ -1,5 +1,5 @@ - + diff --git a/TelenorConnectIosHelloWorld/SignInViewController.swift b/TelenorConnectIosHelloWorld/SignInViewController.swift index 43579da..a74b472 100644 --- a/TelenorConnectIosHelloWorld/SignInViewController.swift +++ b/TelenorConnectIosHelloWorld/SignInViewController.swift @@ -13,7 +13,8 @@ import TDConnectIosSdk class SignInViewController: UIViewController { - var userInfo: AnyObject? + var hasAppeared = false + var performingingSegue = false var oauth2Module: OAuth2Module? let config = TelenorConnectConfig(clientId: "telenordigital-connectexample-ios", redirectUrl: "telenordigital-connectexample-ios://oauth2callback", @@ -28,12 +29,20 @@ class SignInViewController: UIViewController { print("oauth2Module!.isAuthorized()=\(oauth2Module!.isAuthorized())") } + override func viewWillDisappear(animated: Bool) { + super.viewWillDisappear(animated) + hasAppeared = false + performingingSegue = false + } + override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) // Note: The method will be called after (Safari) WebView completes logging in the user - if oauth2Module!.isAuthorized() { + if oauth2Module!.isAuthorized() && !performingingSegue { + performingingSegue = true self.performSegueWithIdentifier("signedIn", sender: nil) } + hasAppeared = true } @IBAction func signInPressed(sender: AnyObject) { @@ -46,21 +55,23 @@ class SignInViewController: UIViewController { return } - oauth2Module.login {(accessToken: AnyObject?, userInfo: OpenIDClaim?, error: NSError?) -> Void in + oauth2Module.requestAccess {(accessToken: AnyObject?, error: NSError?) -> Void in guard let accessToken = accessToken else { print("error=\(error)") return } print("accessToken=\(accessToken)") - self.userInfo = userInfo + if self.hasAppeared && !self.performingingSegue { + self.performingingSegue = true + self.performSegueWithIdentifier("signedIn", sender: nil) + } } } override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) { if (segue.identifier == "signedIn") { let signedInController = segue.destinationViewController as! SignedInViewController - signedInController.userInfo = userInfo signedInController.oauth2Module = oauth2Module } }