-
Notifications
You must be signed in to change notification settings - Fork 430
Add settings menu to login screen #3940
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
NSMutableArray *menuActions = [[NSMutableArray alloc] initWithCapacity:3]; | ||
|
||
// Don't show the change server option if there are no hosts to switch to. | ||
SFManagedPreferences *managedPreferences = [SFManagedPreferences sharedPreferences]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this check to just be around the “Choose Connection” option instead of the settings icon but that would just be for MDM. @wmathurin what do you think about having another property like showServerPicker
on the login config in case an app wants to show the settings icon but hide the change server option? Here’s the existing configuration doc: https://developer.salesforce.com/docs/platform/mobile-sdk/guide/oauth-hide-gear-icon.html
@MainActor | ||
public static func clearCache() async { | ||
let dataStore = WKWebsiteDataStore.default() | ||
let websiteDataTypes: Set<String> = [WKWebsiteDataTypeFetchCache, WKWebsiteDataTypeMemoryCache, WKWebsiteDataTypeDiskCache, WKWebsiteDataTypeOfflineWebApplicationCache] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included any type that had cache in the name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use: WKWebsiteDataStore.allWebsiteDataTypes()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it okay that it would also include the cookies that we have the other method for? Having a way to get rid of everything sounds good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my mind, it was about starting clean. Let me check the Android code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Android we are doing webView.clearCache(true)
(see https://github.com/forcedotcom/SalesforceMobileSDK-Android/pull/2752/files#diff-2b4d6c9697f160bfbefe121309b911622ea530d287a7fbc780a872cfd75cd82aR247) which does not clear the cookies.
To do everything but the cookies we could do
let nonCookieDataTypes: Set<String> = [
WKWebsiteDataTypeDiskCache,
WKWebsiteDataTypeMemoryCache,
WKWebsiteDataTypeLocalStorage,
WKWebsiteDataTypeSessionStorage,
WKWebsiteDataTypeIndexedDBDatabases,
WKWebsiteDataTypeWebSQLDatabases,
WKWebsiteDataTypeOfflineWebApplicationCache,
WKWebsiteDataTypeServiceWorkerRegistrations
]```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good, updated! I also changed the "Clear Cookies" option to use the method that clears the cookies regardless of the cookie management flag, I was thinking that would be better to make sure it starts clean like you said (let me know if you think I should change it back)
Clang Static Analysis Issues
Generated by 🚫 Danger |
[self restartAuthenticationForViewController:loginViewController]; | ||
} | ||
|
||
- (void)loginViewControllerDidClearCache:(SFLoginViewController *)loginViewController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From this comment about reloading, I used the same restart method as the one that happens after the login host is changed
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (1.51%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## dev #3940 +/- ##
==========================================
- Coverage 63.46% 63.32% -0.15%
==========================================
Files 250 250
Lines 22493 22548 +55
==========================================
+ Hits 14276 14278 +2
- Misses 8217 8270 +53
🚀 New features to boost your workflow:
|
Simulator.Screen.Recording.-.iPhone.16e.-.2025-10-08.at.14.57.34.mov