Functions and constants for interacting Sign in with Apple. [icon:ios]
Namespace: | siwa |
Include: | #include <> |
CONSTANTS | |
---|---|
STATE_NOT_FOUND | |
STATE_UNKNOWN | |
STATE_AUTHORIZED | |
STATE_REVOKED | |
STATUS_UNKNOWN | |
STATUS_UNSUPPORTED | |
STATUS_LIKELY_REAL |
FUNCTIONS | |
---|---|
void siwa.is_supported() | |
void siwa.get_credential_state(string user_id, function callback) | |
void siwa.authenticate(function callback) |
void siwa.is_supported()
Check if Sign in with Apple is available (iOS 13+).
PARAMETERS
void siwa.get_credential_state(string user_id, function callback)
Get the credential state of a user.
PARAMETERS
string |
user_id |
User id to get credential state for. |
function |
callback |
Credential state callback function. |
EXAMPLES
siwa.get_credential_state(id, function(self, data)
if data.credential_state == siwa.STATE_AUTHORIZED then
print("User has still authorized the application", data.user_id)
elseif data.credential_state == siwa.STATE_REVOKED then
print("User has revoked authorization for the application", data.user_id)
end
end)
void siwa.authenticate(function callback)
Show the Sign in with Apple UI
PARAMETERS
function |
callback |
Authentication callback function. |
EXAMPLES
siwa.authenticate(function(self, data)
print(data.identity_token)
print(data.user_id)
print(data.first_name, data.family_name)
print(data.email)
if data.user_status == siwa.STATUS_LIKELY_REAL then
print("Likely a real person")
end
end)
The user can’t be found.
Unknown credential state.
The user is authorized.
Authorization for the given user has been revoked.
The system hasn’t determined whether the user might be a real person.
The system can’t determine this user’s status as a real person.
The user appears to be a real person.