<apple-sign-in-button>
The button that starts Sign in with Apple, drawn as Apple's guidelines ask: the Apple logo, one of Apple's titles, its colors and its corners. App Review checks the button against them, so use this rather than drawing your own.
- Its title is in the app's language, as Apple asks. The button the runtime draws off iOS takes it from the app's
LOCALE_ID, whichprovideLocale()sets from the phone's language, in the words iOS's own button uses. It's English for a language iOS has no title in. - Lynx has no such element. This one is AngularLynx's.
Usage
Import LYNX_ELEMENTS in your component (see Elements).
Give it a size, with classes or an inline style. Like iOS's own button, it has none of its own. Apple asks for at least 140 × 30, and 44 tall is the usual height. A CSS rule naming the tag (apple-sign-in-button { … }) styles only iOS's button: the one the runtime draws is a <view>, which it doesn't match. It takes no children.
Attributes
Apple asks for a white button on a dark background, and a black one on a light background. So if the app follows the phone's light or dark appearance, switch button-style with it.
Events
bindtap, as on any element. Call LynxAppleSignIn.signIn() from it.
Platform support
On Android, sign in through Apple's web flow with LynxWebAuthSession, where Apple's guidelines ask for the same button. In the web preview and Lynx Explorer, which have no sign-in, use isAvailable() to leave the button out.
Testing
In the testing library, the button is iOS's element while the fake Sign in with Apple module is there, as it is by default: document.querySelector('apple-sign-in-button') finds it, with its attributes. After setAppleSignInAvailable(false), it's the one the runtime draws, whose title screen.getByText('Sign in with Apple') finds in an English app. A spec that gives render() another LOCALE_ID in its providers finds that language's title. fireEvent.tap() taps either.
Related
LynxAppleSignIn: the sheet the button opens- Apple's Sign in with Apple guidelines
