Skip to content

Example apps: Phase Two branding and a configurable server - #42

Merged
pnzrr merged 2 commits into
mainfrom
jp/example-app-branding
Nov 22, 2026
Merged

pnzrr merged 2 commits into
mainfrom
jp/example-app-branding

Conversation

@pnzrr

@pnzrr pnzrr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Frames the four example apps (ios/KeycloakNativeDemo, android/demo, the React Native example, the Flutter example) with light Phase Two branding, and lets each one point at any Keycloak at runtime instead of only the compose stack. No SDK library code changes; the SDK's default login screens are not restyled.

Branding

Calm and mostly neutral: a launch screen with the slash mark on a neutral background (light and dark), the mark and "Phase Two" on the first screen, the brand blue as accent, and a "Made by Phase Two · phasetwo.io" line. Sources, tokens and the render script are in design/brand (README explains how the PNGs and vector drawables were produced; mark.svg reuses the paths from design/app-icons). Platform system fonts; Inter is not bundled.

App Launch screen Accent / theme
iOS demo UILaunchScreen in Info.plist (UIColorName + UIImageName), no storyboard; set through project.yml and regenerated with XcodeGen Asset-catalog AccentColor (#3B82F6 light, #6EA8FE dark) via ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME
Android demo androidx.core:core-splashscreen 1.0.1 (Theme.Demo.Starting → Theme.Demo), vector icon sized for the 192 dp circle Material 3 light and dark schemes seeded from #3B82F6 (fidelity variant), DemoTheme.kt; previously the app was light only
React Native example No dependency: the template's LaunchScreen.storyboard (iOS); a LaunchTheme with the Android 12 windowSplashScreen* attributes on API 31+, a layer-list before, and MainActivity switching to AppTheme App surfaces follow useColorScheme; buttons use #2563EB, the module's own primary blue
Flutter example No flutter_native_splash: hand-written values-v31 splash attributes plus launch_background.xml (Android) and the template storyboard with a LaunchBackground color set (iOS). Four small resource files beat a generator dependency and its config ColorScheme.fromSeed(#3B82F6, fidelity), light and dark (was indigo, light only)

Where the SDK's screens read the host theme (Compose MaterialTheme, Flutter Theme, SwiftUI tint) they take these colors, as they would an integrating app's. The React Native module's screens are light only, so the example keeps them on a white surface in dark mode.

Configurable server

Each app has a Server screen reachable from its first screen: server URL, realm, client ID (iOS and Android also the other demo clients and the step-up demo API). The issuer is <server>/realms/<realm>.

  • Persisted: UserDefaults (iOS), SharedPreferences (Android), AsyncStorage (React Native, new dependency @react-native-async-storage/async-storage 2.2.0), shared_preferences (Flutter, new dependency). The build-time values stay the defaults, with Reset to defaults.
  • Validated: https only, except plain HTTP to localhost / 127.0.0.1 (and 10.0.2.2 on Android) in line with the existing exceptions. ATS stays at NSAllowsLocalNetworking and the Android cleartext config is unchanged; nothing is broadened.
  • Saving asks for confirmation, then clears every client's stored credentials and the local push enrollment on the device (the old server is not called, since it may be unreachable) and rebuilds the SDK instances. The Android demo replaces its DemoModel (cancelling the old one's scope).
  • Docs: docs/sample-app.md gets a "Server settings" section (with the ATS, cleartext, redirect URI and passkey notes); each example README describes the screen.

Other changes: android/gradle/libs.versions.toml gains core-splashscreen; the React Native Podfile raises pod targets below iOS 17 to 17.0 (AsyncStorage's resource bundle target is 13.4, which current Xcode refuses to build); the React Native example pads for the Android status bar, since SafeAreaView insets on iOS only and the new header ran under it.

Verified

  • iOS demo: swift build and xcodebuild for the iOS 26.4 simulator; screenshots of the launch screen, Scenarios and the Server screen in light and dark; a throwaway XCUITest saved a new realm, relaunched (the setting persisted) and reset to defaults.
  • Android demo: ./gradlew :demo:assembleDebug (warnings as errors); on an API 36 emulator: splash, Login tab and Server screen in light and dark, the validation message, saving an https server (signed out, new issuer), persistence across a force-stop, Reset to defaults.
  • React Native: tsc, eslint, prettier and jest (153 tests); assembleDebug and a simulator xcodebuild (after pod install); on the emulator: splash, home and Server screen in light and dark, validation, save and persistence across a restart.
  • Flutter: flutter analyze, flutter build apk --debug, flutter build ios --simulator --debug; screenshots of the Android splash and home (light and dark), the Server screen, and the iOS launch screen and home in dark mode.

Not verified

  • Nothing was signed in against a running Keycloak: no compose stack was up, so the existing XCUITests, the Flutter integration_test and real logins after a server switch were not run.
  • No physical devices. The React Native iOS app was built but not launched, and the iOS demo's launch screen was checked on the simulator only.
  • The XCUITests assume the default server; reset the Server screen (or delete the app) before running them.

Branding: a launch screen with the Phase Two slash mark in all four example apps (iOS UILaunchScreen without a storyboard; core-splashscreen on the Android demo; dependency-free native launch files for React Native and Flutter), the mark and name on the first screen, the brand blue as accent (iOS AccentColor, Material 3 schemes seeded from #3B82F6), light and dark. Sources and the render script are in design/brand.

Server settings: a Server screen in each app sets the server URL, realm and client IDs at runtime, persisted (UserDefaults, SharedPreferences, AsyncStorage, shared_preferences), validated (https except local development hosts) and with Reset to defaults. Saving clears the stored credentials and local push enrollment and rebuilds the SDK instances. Docs updated.
@pnzrr
pnzrr requested a review from xgp November 20, 2026 14:21
@pnzrr
pnzrr merged commit ddbcf84 into main Nov 22, 2026
12 checks passed
@pnzrr
pnzrr deleted the jp/example-app-branding branch November 22, 2026 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants