react-native-persona 2.2.20 → 2.2.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/ios/PersonaInquiry2.swift +18 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -54,20 +54,35 @@ class PersonaInquiry2: RCTEventEmitter {
|
|
|
54
54
|
fields: fieldsFrom(fieldsObject)
|
|
55
55
|
)
|
|
56
56
|
DispatchQueue.main.async {
|
|
57
|
-
guard let
|
|
58
|
-
|
|
57
|
+
guard let viewController = self.findTopViewController() else {
|
|
58
|
+
self.sendEvent(
|
|
59
|
+
withName: "onError",
|
|
60
|
+
body: [
|
|
61
|
+
"debugMessage": "Couldn't resolve a root view controller"
|
|
62
|
+
]
|
|
63
|
+
)
|
|
59
64
|
return
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
Inquiry(
|
|
63
68
|
config: config,
|
|
64
69
|
delegate: self
|
|
65
|
-
).start(from:
|
|
70
|
+
).start(from: viewController)
|
|
66
71
|
}
|
|
67
72
|
} catch {
|
|
68
73
|
print("An error occurred while starting the Inquiry: \(error.localizedDescription)")
|
|
69
74
|
}
|
|
70
75
|
}
|
|
76
|
+
|
|
77
|
+
func findTopViewController() -> UIViewController? {
|
|
78
|
+
// Resolve rootViewController to top most presented view controller
|
|
79
|
+
var topViewController = UIApplication.shared.keyWindow?.rootViewController
|
|
80
|
+
while let presentedViewController = topViewController?.presentedViewController {
|
|
81
|
+
topViewController = presentedViewController
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return topViewController
|
|
85
|
+
}
|
|
71
86
|
}
|
|
72
87
|
|
|
73
88
|
// MARK: - Inquiry Delegate Methods
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-persona",
|
|
3
3
|
"title": "React Native Persona",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.21",
|
|
5
5
|
"description": "Launch a mobile native implementation of the Persona inquiry flow from React Native.",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
7
7
|
"module": "lib/module/index",
|