# Modules.Applesignin
A module to use apple signin functionality.
# Overview
# Apple sign in Resources
# Requirements
- iOS 13 and later
# Getting Started
# Configure iOS: Capabilities and Provisioning Profiles
Required capabilities:
<key>com.apple.developer.applesignin</key> <array> <string>Default</string> </array>
Provisioning Profile entitled with 'Sign In with Apple' capability
# Accessing the Module
Use
require
to access this module from JavaScript:var AppleSignin = require('ti.applesignin');
The
AppleSignin
variable is a reference to the Module object.
# Example applications
- Example applications are located in the
example/ios
folder of the module:
# Methods
# authorize
Request Apple ID authorization.
After authorizarion it will fire event login event which tells success or failure of login.
Parameters
Name | Type | Description |
---|---|---|
scopes | Array<Number> | The contact information to be requested from the user during authentication. Use the Modules.Applesignin.AUTHORIZATION_SCOPE_* constant values to populate the array. |
Returns
- Type
- void
# createLoginButton
Creates and returns an instance of Modules.Applesignin.LoginButton.
Parameters
Name | Type | Description |
---|---|---|
parameters | Dictionary<Modules.Applesignin.LoginButton> | Properties to set on a new object, including any defined by Modules.Applesignin.LoginButton except those marked not-creation or read-only. |
Returns
# getCredentialState
Returns the credential state for the given user.
This method returns immediately without waiting for tasks to finish. Once a session is invalidated,
new tasks cannot be created in the session, but existing tasks continue until completion. Once
invalidated, references to the events and callback objects are broken. Session objects cannot be
reused. To cancel all outstanding tasks, call invalidateAndCancel
instead.
Parameters
Name | Type | Description |
---|---|---|
userId | String | A string, <Modules.Applesignin.ProfileObject.userId>, associated with the Apple ID that your app receives in login event. |
callback | Callback<CredentialStateResponse> | Function to invoke on success or failure. |
Returns
- Type
- void
# Events
# login
Fired at login.
Properties
Name | Type | Description |
---|---|---|
success | Boolean | Indicates if the user was logged in successfully.
Returns |
cancelled | Boolean | Indicates if the user cancelled the login request by closing the dialog. |
error | String | Error message, if any returned. Will be undefined if |
profile | ProfileObject | User profile returned after successful login. |
source | Object | Source object that fired the event. |
type | String | Name of the event fired. |
bubbles | Boolean | True if the event will try to bubble up if possible. |
cancelBubble | Boolean | Set to true to stop the event from bubbling. |
# Constants
# AUTHORIZATION_SCOPE_EMAIL
A scope that includes the user's email address.
# AUTHORIZATION_SCOPE_FULLNAME
A scope that includes the user's full name.
# BUTTON_STYLE_WHITE_OUTLINE
Authorization button style white outline. Use with style.
# BUTTON_TYPE_CONTINUE
Continue authorization button type. Use with type.
# CREDENTIAL_STATE_REVOKED
Authorization for the given user has been revoked.
# USER_DETECTION_STATUS_REAL
The user appears to be a real person.
# USER_DETECTION_STATUS_UNKNOWN
The system hasn't determined whether the user might be a real person.
# USER_DETECTION_STATUS_UNSUPPORTED
The system can't determine this user's status as a real person.