Add public API to trigger Login for Admin flow.#4026
Add public API to trigger Login for Admin flow.#4026brandonpage merged 2 commits intoforcedotcom:devfrom
Conversation
Clang Static Analysis Issues
Generated by 🚫 Danger |
|
||||||||||||||||
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #4026 +/- ##
==========================================
+ Coverage 65.64% 66.48% +0.83%
==========================================
Files 245 245
Lines 21449 21449
==========================================
+ Hits 14081 14261 +180
+ Misses 7368 7188 -180
🚀 New features to boost your workflow:
|
|
||||||||||||||
|
||||||||||||||||||
| @param loginViewController The login view controller whose scene's active auth session should | ||
| switch to "Login for Admin". Its window's scene is used to locate the session. | ||
| */ | ||
| - (void)loginViewControllerDidSelectLoginForAdmin:(SFLoginViewController *)loginViewController NS_SWIFT_NAME(loginViewControllerDidSelectLoginForAdmin(_:)) SFSDK_DEPRECATED(13.2.1, 14.0, "Will be removed in 14.0 when a permanent solution if provided."); |
There was a problem hiding this comment.
Typo: "when a permanent solution if provided" should be "when a permanent solution is provided"
| @param loginViewController The login view controller whose scene's active auth session should | ||
| switch to "Login for Admin". Its window's scene is used to locate the session. | ||
| */ | ||
| - (void)loginViewControllerDidSelectLoginForAdmin:(SFLoginViewController *)loginViewController NS_SWIFT_NAME(loginViewControllerDidSelectLoginForAdmin(_:)) SFSDK_DEPRECATED(13.2.1, 14.0, "Will be removed in 14.0 when a permanent solution if provided."); |
There was a problem hiding this comment.
Where would the app get the reference to the login view controller from? the window?
There was a problem hiding this comment.
@bbirman Good callout. As I see it they have two options:
- Retain a reference from
UserAccountManager.shared.loginViewControllerConfig.loginViewControllerCreationBlock. - Walk the view hierarchy.
I assume option 1 is preferred? Should I add that to the comment?
There was a problem hiding this comment.
Were you able to test with option 1? I think the reference would be to the block, not the view controller created by the block?
Otherwise I was wondering if option 2 could use SFSDKWindowManager's authWindow's topViewController, or if there's a way to get around the app providing the reference, but do we know if anyone is hiding the settings icon? Might not be worth it to invest more if not
There was a problem hiding this comment.
I was thinking something like this:
UserAccountManager.shared.loginViewControllerConfig.loginViewControllerCreationBlock = { [weak self] in
let vc = SalesforceLoginViewController()
self?.currentLoginVC = vc // retain weakly for later
return vc
}
There was a problem hiding this comment.
ah gotchya! no preference for me, whatever you think looks cleanest
No description provided.