You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dark Mode style configuration API and Example app toggle (#4509)
## Summary
#### [Commit 1](c0ad249):
Creates a `Configuration` API for the `FinancialConnectionsSheet`, which
is internal-only (for now). The configuration API allows consumers
specify their preference for styling the sheet, with these options;
- `automatic`: Appearance will reflect the device's theme, and
dynamically switch accordingly.
- `alwaysLight`: Appearance will always use colors appropriate for a
light theme.
- This is the default value for now. The default value is likely to
switch over to `automatic` once we release this API.
- `alwaysDark`: Appearance will always use colors appropriate for a dark
theme.
Usage of this API follows the same approach as the configuration API in
MPE
([docs](https://docs.stripe.com/payments/accept-a-payment?platform=ios&ui=payment-sheet#dark-mode)).
Here's what that looks like:
```swift
var configuration = FinancialConnectionsSheet.Configuration()
configuration.style = .alwaysDark
financialConnectionsSheet.configuration = configuration
```
> [!IMPORTANT]
>Reminder that the API described here is internal-only until a proper
API review takes places. Anything mentioned here is subject to change
between now and the public release.
#### [Commit
2](c43205f):
Adds a toggle and style picker in the Financial Connections Example app
to test the API mentioned above. Unless the `Use dynamic style` toggle
is enabled, the FC flow should always use a light theme. Otherwise, it
should reflect the value in the style picker
<img width="515" alt="image"
src="https://github.com/user-attachments/assets/fc7a269e-eb12-4350-87e6-b2a857a6e32c"
/>
#### [Commit
3](9bedd68):
Passes along the value set in the MPE
`PaymentSheet.Configuration.UserInterfaceStyle` along to the FC
configuration API, whenever FC is launched from payment sheet. This will
ensure users integrating both MPE and FC won't need to make any
integration changes to get their desired style configuration.
> [!IMPORTANT]
>Reminder that this will have no functional changes until this API is
released. FC will continue to always present in "light mode" until we
publicize the `Configuration` API, and remove the `ExperimentStore`
guardrails we have in place.
## Motivation
https://docs.google.com/document/d/1bGRPh8J8dvie-JEG4q43DycIBr5zY1GoGF-0RFf0L_Q/edit?usp=sharing
## Testing
https://github.com/user-attachments/assets/960cb29a-161d-4fd5-a2f4-dba9676876ea
## Changelog
N/a
Copy file name to clipboardexpand all lines: Example/FinancialConnections Example/FinancialConnections Example/Playground/PlaygroundConfiguration.swift
+66-8
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
//
7
7
8
8
import Foundation
9
+
@_spi(STP)import StripeFinancialConnections
9
10
10
11
/// Provides an interface to customize the playground configuration
11
12
/// (which is stored as a JSON in NSUserDefaults).
@@ -444,12 +445,6 @@ final class PlaygroundConfiguration {
Copy file name to clipboardexpand all lines: StripeFinancialConnections/StripeFinancialConnections/Source/FinancialConnectionsSDK/FinancialConnectionsSDKImplementation.swift
+10
Original file line number
Diff line number
Diff line change
@@ -32,6 +32,16 @@ public class FinancialConnectionsSDKImplementation: FinancialConnectionsSDKInter
0 commit comments