Example app
example/ is a NitroUI app that calls every API: the HIG-styled AppleSignInButton, a sign-in with nonce and state, a credential-state check, and an option to forget the credential. On Android it shows that Sign in with Apple is unavailable.
| File | Contents |
|---|---|
example/src/App.tsx | The screen that calls isSupported, signIn and getCredentialState. |
example/src/AppleSignInButton.tsx | The copyable sign-in button. |
example/ios/NitroUI/NitroUI.entitlements | The Sign in with Apple entitlement. |
example/__tests__ | Native harness tests for iOS and Android. |
Configure signing
The iOS target already has the Sign in with Apple entitlement. A real sign-in also needs an App ID with Sign in with Apple enabled in your team. Put your team and bundle identifier in example/.env, which example/ios/Signing.xcconfig reads:
cp example/.env.example example/.env # then set APPLE_TEAM_ID and APP_BUNDLE_ID
Sign the device or simulator in to an Apple ID.
Run
cd example
bun run nitro-ui prepare
bun run ios --device <simulator-UDID>
bun run android --device <adb-serial> # shows that Sign in with Apple is unavailable