diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index d80cca72..b0da8349 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -3,6 +3,6 @@ Contributors
Contributors to the codebase, in reverse chronological order:
+- Eric Mentele, @EricMentele
- Dave Carlson, @drdavec
- Pascal Pfiffner, @p2
-
diff --git a/Info.plist b/Info.plist
index ce342660..187703aa 100644
--- a/Info.plist
+++ b/Info.plist
@@ -15,11 +15,11 @@
CFBundlePackageType
FMWK
CFBundleShortVersionString
- 4.2.0
+ $(MARKETING_VERSION)
CFBundleSignature
????
CFBundleVersion
- 4.2.0.0
+ $(CURRENT_PROJECT_VERSION)
NSPrincipalClass
diff --git a/Sources/iOS/Auth+iOS.swift b/Sources/iOS/Auth+iOS.swift
index 26ad7c1a..64189e41 100644
--- a/Sources/iOS/Auth+iOS.swift
+++ b/Sources/iOS/Auth+iOS.swift
@@ -20,7 +20,17 @@ extension Auth {
- parameter callback: The callback that is called when authorization completes or fails
*/
func authorize(with oauth: OAuth2, properties: SMARTAuthProperties, callback: @escaping ((OAuth2JSON?, OAuth2Error?) -> Void)) {
- authContext = UIApplication.shared.keyWindow?.rootViewController
+
+ let rootViewController = UIApplication.shared.keyWindow?.rootViewController
+ authContext = rootViewController
+
+ if var topController = rootViewController {
+ while let presentedViewController = topController.presentedViewController {
+ topController = presentedViewController
+ }
+
+ authContext = topController
+ }
oauth.authConfig.authorizeContext = authContext
oauth.authConfig.authorizeEmbedded = properties.embedded
diff --git a/SwiftSMART.xcodeproj/project.pbxproj b/SwiftSMART.xcodeproj/project.pbxproj
index 84707f90..cb5eeff7 100644
--- a/SwiftSMART.xcodeproj/project.pbxproj
+++ b/SwiftSMART.xcodeproj/project.pbxproj
@@ -555,7 +555,7 @@
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
- CURRENT_PROJECT_VERSION = 1;
+ CURRENT_PROJECT_VERSION = 4.2.1.0;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -567,6 +567,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
+ MARKETING_VERSION = 4.2.1;
METAL_ENABLE_DEBUG_INFO = YES;
"OTHER_SWIFT_FLAGS[arch=*]" = "-DDEBUG -DNO_MODEL_IMPORT -DNO_MODULE_IMPORT -DNO_KEYCHAIN_IMPORT";
PRODUCT_BUNDLE_IDENTIFIER = "org.chip.${PRODUCT_NAME:rfc1034identifier}";
@@ -584,7 +585,7 @@
isa = XCBuildConfiguration;
buildSettings = {
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "";
- CURRENT_PROJECT_VERSION = 1;
+ CURRENT_PROJECT_VERSION = 4.2.1.0;
DEFINES_MODULE = YES;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
@@ -596,6 +597,7 @@
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
+ MARKETING_VERSION = 4.2.1;
METAL_ENABLE_DEBUG_INFO = NO;
"OTHER_SWIFT_FLAGS[arch=*]" = "-DNO_MODEL_IMPORT -DNO_KEYCHAIN_IMPORT -DNO_MODULE_IMPORT";
PRODUCT_BUNDLE_IDENTIFIER = "org.chip.${PRODUCT_NAME:rfc1034identifier}";