Skip to content

Add Sign in with Apple login page#40

Draft
muvaf wants to merge 2 commits into
mainfrom
cursor/login-with-apple-id-409c
Draft

Add Sign in with Apple login page#40
muvaf wants to merge 2 commits into
mainfrom
cursor/login-with-apple-id-409c

Conversation

@muvaf

@muvaf muvaf commented May 11, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements a Sign in with Apple login experience for the sample iOS app.

When the app launches signed-out, the user lands on a custom dark-gradient LoginView featuring the Apple logo, a "Welcome" headline, a subtitle, the system SignInWithAppleButton, and a Terms of Service / Privacy Policy footer. Tapping the button invokes the standard ASAuthorizationAppleIDProvider flow; on success the app routes to SignedInView, which displays the returned name / email / user ID and offers a Sign Out action that returns to the login page.

Changes

  • sample-native-app/AuthState.swiftObservableObject that holds the current user's identifier, full name and email, persists them in UserDefaults, and exposes signIn / signOut / setError. (Apple only returns name + email on the very first authorization, so subsequent sign-ins do not overwrite cached values with nil.)
  • sample-native-app/LoginView.swift – SwiftUI login screen using AuthenticationServices.SignInWithAppleButton. Real failures are surfaced as an in-app error banner; user-canceled / .unknown ASAuthorizationError codes (what the simulator returns when the sheet is dismissed) are swallowed so the user does not see a confusing red banner.
  • sample-native-app/SignedInView.swift – Post-sign-in screen showing name / email / user ID and a Sign Out button.
  • sample-native-app/ContentView.swift / sample_native_appApp.swift – Inject AuthState as an environment object and switch between login and signed-in views.
  • sample-native-app/sample-native-app.entitlements – Adds com.apple.developer.applesignin = ["Default"], with CODE_SIGN_ENTITLEMENTS wired into both Debug and Release configurations in project.pbxproj.

Verification

Built and ran on a Limrun iOS simulator (lim xcode build .):

  • The login page renders with the Apple logo, "Welcome" heading, subtitle, white "Sign in with Apple" button, and the two-line terms footer.
  • Tapping the button invokes the system Sign in with Apple sheet, confirming the entitlement is recognized.
  • Dismissing the sheet returns to the login page with no error banner (the simulator's .unknown error is intentionally filtered out).

Login page

Sign in with Apple login page

Walkthrough video

login_page_walkthrough.mp4

Preview link

Open in Limrun simulator

To show artifacts inline, enable in settings.

Linear Issue: LIM-277

Open in Web Open in Cursor 

cursoragent and others added 2 commits May 11, 2026 22:44
Adds a SwiftUI login experience that uses ASAuthorizationAppleIDProvider via
SignInWithAppleButton. The app now shows LoginView when signed out and
SignedInView (with name/email/user ID and a sign-out button) once an Apple
credential has been returned. AuthState persists the user identifier (and any
returned name/email) in UserDefaults.

Also enables the Sign in with Apple capability by adding
sample-native-app.entitlements and wiring CODE_SIGN_ENTITLEMENTS into both
Debug and Release build configurations.

Co-authored-by: muvaffak <me@muvaf.com>
- Add explicit 'import Combine' so AuthState's @published / ObservableObject
  resolve under the project's MemberImportVisibility upcoming feature; without
  this the build fails with 'AuthState does not conform to ObservableObject'.
- Bump LoginView's bottom inset so the two-line Terms of Service / Privacy
  Policy footer stays clear of the home indicator.

Co-authored-by: muvaffak <me@muvaf.com>
@github-actions

Copy link
Copy Markdown

Limrun Preview

Platform Commit Preview
iOS 5eeec58 Open Preview →

Reviewer must be a member of the organization on Limrun.

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