
## Set Client State delegate
---
This method sets an object for a customer's state delegate methods.
**Declared In:**  
Headers/SNRClient.h
  
**Related To:**  
[ClientStateDelegate](/developers/mobile-sdk/listeners-and-delegates/ios-delegates#client-state-delegate)  
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1012">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1012-0" data-tab-group="tabgrp-1012" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1012-1" data-tab-group="tabgrp-1012">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1012-0" data-tab-group="tabgrp-1012" data-tab-active="true">

```Swift
static func setClientStateDelegate(_ delegate: ClientStateDelegate)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1012-1" data-tab-group="tabgrp-1012">

```Objective-C
+ (void)setClientStateDelegate:(SNRClientStateDelegate *)delegate
```

</div>
</div>

  
**Discussion:**  
Learn more about the methods and the purpose of this listener [here](/developers/mobile-sdk/listeners-and-delegates/ios-delegates#client-state-delegate).

## Register customer account
---
This method registers a new customer with an email, password, and optional data.
  
This method requires the context object with a customer’s email, password, and optional data. Omitted fields are not modified.
  
Depending on the backend configuration, the account may require activation. For details, see  [customer registration](/developers/mobile-sdk/user-identification-and-authorization/overview).
  
Do not allow signing in again (or signing up) when a customer is already signed in. Sign the customer out first.
  
Do not create multiple instances nor call this method multiple times before execution.
  
This method is a global operation and doesn't require customer authentication.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_REGISTER_CLIENT_CREATE` permission from the **Client** group.

</div></div></div>

**Declared In:**  
Headers/SNRClient.h
  
**Related To:**  
[ClientRegisterAccountContext](/developers/mobile-sdk/class-reference/ios/client#clientregisteraccountcontext)
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1013">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1013-0" data-tab-group="tabgrp-1013" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1013-1" data-tab-group="tabgrp-1013">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1013-0" data-tab-group="tabgrp-1013" data-tab-active="true">

```Swift
static func registerAccount(context: ClientRegisterAccountContext, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1013-1" data-tab-group="tabgrp-1013">

```Objective-C
+ (void)registerAccount:(nonnull SNRClientRegisterAccountContext *)context success:(nonnull void (^)(void))success failure:(nonnull void (^)(NSError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **context** | [ClientRegisterAccountContext](/developers/mobile-sdk/class-reference/ios/client#clientregisteraccountcontext) | yes | - | Object with the customer's email, password, and other optional data |
| **success** | (() -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Since version 5.0.0, the **success** closure does NOT contain the `isSuccess` parameter.

</div></div></div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1014">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1014-0" data-tab-group="tabgrp-1014" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1014-1" data-tab-group="tabgrp-1014">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1014-0" data-tab-group="tabgrp-1014" data-tab-active="true">

```Swift
let agreements: ClientAgreements = ClientAgreements()
agreements.email = true
agreements.sms = true
agreements.push = true
agreements.bluetooth = true
agreements.rfid = true
agreements.wifi = true
let email: String = "YOUR_EMAIL"
let password: String = "YOUR_PASSWORD"
let context: ClientRegisterAccountContext = ClientRegisterAccountContext(email: email, password: password)
context.firstName = "FIRST_NAME"
context.lastName = "LAST_NAME"
context.customId = "CUSTOM_ID"
context.sex = .male
context.phone = "123-456-789"
context.company = "Synerise"
context.address = "Lubostroń 1"
context.city = "Kraków"
context.province = "Małopolskie"
context.zipCode = "30-383"
context.countryCode = "+48"
context.agreements = agreements
context.attributes = ["attribute1": "value1", "attribute2": "value2"]
context.tags = ["tag1", "tag2" "tag3"]
Client.registerAccount(context: context, success: {
  // success
}, failure: { (error) in
  // failure
})
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1014-1" data-tab-group="tabgrp-1014">

```Objective-C
SNRClientAgreements *agreements = [SNRClientAgreements new];
agreements.email = true;
agreements.sms = true;
agreements.push = true;
agreements.bluetooth = true;
agreements.rfid = true;
agreements.wifi = true;
NSString *email = @"EMAIL";
NSString *password = @"PASSWORD";
SNRClientRegisterAccountContext *context = [SNRClientRegisterAccountContext alloc] initWithEmail:email andPassword:password];
context.firstName = @"FIRST_NAME";
context.lastName = @"LAST_NAME";
context.customId = @"CUSTOM_ID";
context.sex = SNRClientSexMale;
context.phone = @"123-456-789";
context.company = @"Synerise";
context.address = @"Lubostroń 1";
context.city = @"Kraków";
context.province = @"Małopolskie";
context.zipCode = @"30-383";
context.countryCode = @"+48";
context.agreements = agreements;
context.attributes = @{@"attribute": @"value"};
context.tags = @[@"tag1", @"tag2" @"tag3"];
[SNRClient registerAccount:context success:^() {
  // success
} failure:^(SNRApiError *error) {
  // failure
}];
```

</div>
</div>


## Request customer account activation
---
This method requests sending an email with a URL that confirms the registration and activates the account.
  
This method is a global operation and doesn't require customer authentication.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_CONFIRMATION_CLIENT_CREATE` permission from the **Client** group.

</div></div></div>

**Declared In:**  
Headers/SNRClient.h

**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1015">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1015-0" data-tab-group="tabgrp-1015" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1015-1" data-tab-group="tabgrp-1015">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1015-0" data-tab-group="tabgrp-1015" data-tab-active="true">

```Swift
static func requestAccountActivation(email: String, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1015-1" data-tab-group="tabgrp-1015">

```Objective-C
+ (void)requestAccountActivationWithEmail:(nonnull NSString *)email success:(nonnull void (^)(void))success failure:(nonnull void (^)(NSError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - | Customer's email |
| **success** | (() -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Before version 5.0.0, this method was called `Synerise.activateAccount(email:success:failure:)`.

</div></div></div>



<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Since version 5.0.0, the **success** closure does NOT contain the `isSuccess` parameter.

</div></div></div>


**Return Value:**  
No value is returned.

**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1016">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1016-0" data-tab-group="tabgrp-1016" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1016-1" data-tab-group="tabgrp-1016">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1016-0" data-tab-group="tabgrp-1016" data-tab-active="true">

```Swift
let email: String = "EMAIL"
Client.requestAccountActivation(email: email, success: {
  // success   
}) { (error) in
  // failure 
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1016-1" data-tab-group="tabgrp-1016">

```Objective-C
NSString *email = @"EMAIL";
[SNRClient requestAccountActivationWithEmail:email success:^() {
  // success
} failure:^(NSError * error) {
  // failure
}];
```

</div>
</div>


## Confirm customer account activation
---
This method confirms a customer account with the confirmation token.
  
This method is a global operation and doesn't require customer authentication.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 400 status code if the account is already confirmed or 404 if the account does not exist.

</div></div></div>



<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_CONFIRMATION_CLIENT_CREATE` permission from the **Client** group.

</div></div></div>

**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)

**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1017">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1017-0" data-tab-group="tabgrp-1017" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1017-1" data-tab-group="tabgrp-1017">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1017-0" data-tab-group="tabgrp-1017" data-tab-active="true">

```Swift
static func confirmAccountActivation(token: String, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1017-1" data-tab-group="tabgrp-1017">

```Objective-C
+ (void)confirmAccountActivationByToken:(nonnull NSString *)token success:(nonnull void (^)(void))success failure:(nonnull void (^)(NSError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **token** | String | yes | - | Confirmation token |
| **success** | (() -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Before version 5.0.0, this method was called `Synerise.confirmAccount(token:success:failure:)`.

</div></div></div>

  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Since version 5.0.0, the **success** closure does NOT contain the `isSuccess` parameter.

</div></div></div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1018">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1018-0" data-tab-group="tabgrp-1018" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1018-1" data-tab-group="tabgrp-1018">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1018-0" data-tab-group="tabgrp-1018" data-tab-active="true">

```Swift
let token: String = "TOKEN"
Client.confirmAccountActivation(token: token, success: {
  // success
}, failure: { (error) in
  // failure
})
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1018-1" data-tab-group="tabgrp-1018">

```Objective-C
NSString *token = @"TOKEN";
[SNRClient confirmAccountActivationByToken:token success:^() {
  // success
} failure:^(SNRApiError *error) {
  // failure
}];
```

</div>
</div>


## Request customer account activation by pin
---
This method requests a customer's account registration process with the PIN code.
  
This method is a global operation and doesn't require customer authentication.


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_PIN_CODE_RESEND_CLIENT_CREATE` permission from the **Client** group.

</div></div></div>

**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1019">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1019-0" data-tab-group="tabgrp-1019" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1019-1" data-tab-group="tabgrp-1019">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1019-0" data-tab-group="tabgrp-1019" data-tab-active="true">

```Swift
static func requestAccountActivationByPin(email: String, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1019-1" data-tab-group="tabgrp-1019">

```Objective-C
+ (void)requestAccountActivationByPinWithEmail:(nonnull NSString *)email success:(nonnull void (^)(void))success failure:(nonnull void (^)(SNRApiError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - | Customer's email |
| **success** | (() -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Since version 5.0.0, the **success** closure does NOT contain the `isSuccess` parameter.

</div></div></div>


**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1020">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1020-0" data-tab-group="tabgrp-1020" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1020-1" data-tab-group="tabgrp-1020">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1020-0" data-tab-group="tabgrp-1020" data-tab-active="true">

```Swift
let email: String = "EMAIL"
Client.requestAccountActivationByPin(email: email, success: {
  // success
}) { (error) in
  // failure
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1020-1" data-tab-group="tabgrp-1020">

```Objective-C
NSString *email = @"EMAIL";
[SNRClient requestAccountActivationByPinWithEmail:email success:^() {
  // success
} failure:^(SNRApiError *error) {
  // failure
}];
```

</div>
</div>


## Confirm customer account activation by pin
---
This method confirms a customer's account registration process with the PIN code.
  
This method is a global operation and doesn't require customer authentication.
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_PIN_CODE_RESEND_CLIENT_CREATE` permission from the **Client** group.

</div></div></div>

**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)

**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1021">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1021-0" data-tab-group="tabgrp-1021" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1021-1" data-tab-group="tabgrp-1021">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1021-0" data-tab-group="tabgrp-1021" data-tab-active="true">

```Swift
static func confirmAccountActivationByPin(pinCode: String, email: String, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1021-1" data-tab-group="tabgrp-1021">

```Objective-C
+ (void)confirmAccountActivationByPin:(nonnull NSString *)pinCode email:(nonnull NSString *)email success:(nonnull void (^)(void))success failure:(nonnull void (^)(SNRApiError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **pinCode** | String | yes | - | Code sent to a customer's email |
| **email** | String | yes | - | Customer's email |
| **success** | (() -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Since version 5.0.0, the **success** closure does NOT contain the `isSuccess` parameter.

</div></div></div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1022">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1022-0" data-tab-group="tabgrp-1022" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1022-1" data-tab-group="tabgrp-1022">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1022-0" data-tab-group="tabgrp-1022" data-tab-active="true">

```Swift
let pinCode: String = "PIN_CODE"
let email: String = "EMAIL"
Client.confirmAccountActivationByPin(pinCode: pinCode, email: email, success: {
  // success
}) { (error) in
  // failure
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1022-1" data-tab-group="tabgrp-1022">

```Objective-C
NSString *pinCode = @"PIN_CODE";
NSString *email = @"EMAIL";
[SNRClient confirmAccountActivationByPin:pinCode email:email success:^() {
  // success
} failure:^(SNRApiError *error) {
  // failure
}];
```

</div>
</div>


## Sign in a customer
---
This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.
  
The SDK will refresh the token before each call if it is about to expire (but not expired).
  
Do NOT allow signing in again (or signing up) when a customer is already signed in. First, sign the customer out.
  
Do NOT create multiple instances nor call this method multiple times before execution.
**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)

**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1023">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1023-0" data-tab-group="tabgrp-1023" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1023-1" data-tab-group="tabgrp-1023">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1023-0" data-tab-group="tabgrp-1023" data-tab-active="true">

```Swift
static func signIn(email: String, password: String, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1023-1" data-tab-group="tabgrp-1023">

```Objective-C
+ (void)signInWithEmail:(nonnull NSString *)email password:(nonnull NSString *)password success:(nonnull void (^)(void))success failure:(nonnull void (^)(NSError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - | Customer's email |
| **password** | String | yes | - | Customer's password |
| **success** | (() -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Since version 5.0.0, the **success** closure does NOT contain the `isSuccess` parameter.

</div></div></div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1024">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1024-0" data-tab-group="tabgrp-1024" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1024-1" data-tab-group="tabgrp-1024">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1024-0" data-tab-group="tabgrp-1024" data-tab-active="true">

```Swift
let email: String = "EMAIL"
let password: String = "PASSWORD"
Client.signIn(email: email, password: password, success: {
  // success
}, failure: { (error) in
  // failure
})
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1024-1" data-tab-group="tabgrp-1024">

```Objective-C
NSString *email = @"EMAIL";
NSString *password = @"PASSWORD";
[SNRClient signInWithEmail:email password:password success:^() {
  // success
} failure:^(SNRApiError *error) {
  // failure
}];
```

</div>
</div>


## Sign in a customer conditionally
---
This method signs a customer in to obtain a JSON Web Token (JWT) which can be used in subsequent requests.
  
The SDK will refresh the token before each call if it is about to expire (but not expired).
  
Do NOT allow signing in again (or signing up) when a customer is already signed in. First, sign the customer out.
  
Do NOT create multiple instances nor call this method multiple times before execution.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1025">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1025-0" data-tab-group="tabgrp-1025" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1025-1" data-tab-group="tabgrp-1025">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1025-0" data-tab-group="tabgrp-1025" data-tab-active="true">

```Swift
static func signInConditionally(email: String, password: String, success: ((ClientAuthenticationResult) -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1025-1" data-tab-group="tabgrp-1025">

```Objective-C
+ (void)signInConditionallyWithEmail:(nonnull NSString *)email password:(nonnull NSString *)password success:(nonnull void (^)(SNRClientAuthenticationResult *result))success failure:(nonnull void (^)(NSError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **email** | String | yes | - | Customer's email |
| **password** | String | yes | - | Customer's password |
| **success** | ((ClientAuthenticationResult) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1026">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1026-0" data-tab-group="tabgrp-1026" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1026-1" data-tab-group="tabgrp-1026">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1026-0" data-tab-group="tabgrp-1026" data-tab-active="true">

```Swift
let email: String = "EMAIL"
let password: String = "PASSWORD"
Client.signInConditionally(email: email, password: password, success: { (result) in
  // success
}, failure: { (error) in
  // failure
})
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1026-1" data-tab-group="tabgrp-1026">

```Objective-C
NSString *email = @"EMAIL";
NSString *password = @"PASSWORD";
[SNRClient signInConditionallyWithEmail:email password:password success:^(SNRClientAuthenticationResult *result) {
  // success
} failure:^(SNRApiError *error) {
  // failure
}];
```

</div>
</div>


## Authenticate customer by IdentityProvider
---
This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.
  
If an account for the customer does not exist and the identity provider is different than Synerise, this request creates an account.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | 0.3.0 |
**Declared In:**  
Headers/SNRClient.h
  
**Related To:**  
[ClientAuthenticationContext](/developers/mobile-sdk/class-reference/ios/client#clientauthenticationcontext)  
[ClientIdentityProivider](/developers/mobile-sdk/class-reference/ios/client#clientidentityprovider)
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1027">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1027-0" data-tab-group="tabgrp-1027" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1027-1" data-tab-group="tabgrp-1027">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1027-0" data-tab-group="tabgrp-1027" data-tab-active="true">

```Swift
static func authenticate(token: AnyObject, clientIdentityProvider: ClientIdentityProvider, authID: String?, context: ClientAuthenticationContext?, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1027-1" data-tab-group="tabgrp-1027">

```Objective-C
+ (void)authenticateWithToken:(id)token clientIdentityProvider:(SNRClientIdentityProvider)clientIdentityProvider authID:(nullable NSString *)authID context:(nullable SNRClientAuthenticationContext *)context success:(void (^)(void))success failure:(void (^)(SNRApiError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **token** | AnyObject | yes | - | Token retrieved from provider |
| **clientIdentityProvider** | [ClientIdentityProvider](/developers/mobile-sdk/class-reference/ios/client#clientidentityprovider) | yes | - | Provider of your token |
| **authID** | String | no | nil | Optional identifier of authorization |
| **context** | [ClientAuthenticationContext](/developers/mobile-sdk/class-reference/ios/client#clientauthenticationcontext) | no | nil | Object which contains agreements and attributes |
| **success** | (() -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>



<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Since version 5.0.0, the **success** closure does NOT contain the `isSuccess` parameter.

</div></div></div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1028">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1028-0" data-tab-group="tabgrp-1028" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1028-1" data-tab-group="tabgrp-1028">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1028-0" data-tab-group="tabgrp-1028" data-tab-active="true">

```Swift
let agreements: ClientAgreements = ClientAgreements()
agreements.email = true
agreements.sms = true
agreements.push = true
agreements.bluetooth = true
agreements.rfid = true
agreements.wifi = true
let context: ClientAuthenticationContext = ClientAuthenticationContext()
context.agreements = agreements
context.attributes = ["attribute1": "value1", "attribute2": "value2"]
let accessToken: String = "ACCESS_TOKEN"
let authID: String = "AUTH_ID"
Client.authenticate(token: token, authID: authID, context: context, success: {
  // success
}) { (error) in
  // failure   
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1028-1" data-tab-group="tabgrp-1028">

```Objective-C
SNRClientAgreements *agreements = [SNRClientAgreements new];
agreements.email = true;
agreements.sms = true;
agreements.push = true;
agreements.bluetooth = true;
agreements.rfid = true;
agreements.wifi = true;
SNRClientAuthenticationContext *context = [SNRClientAuthenticationContext new];
context.agreements = agreements;
context.attributes = @{"attribute1": "value1", "attribute2": "value2"};
NSString *accessToken = @"ACCESS_TOKEN";
NSString *authID = @"AUTH_ID";
[SNRClient authenticateWithToken:token authID:authID context:context success:^() {
  // success
} failure:^(SNRApiError *error) {
  // failure  
}];
```

</div>
</div>


## Authenticate customer conditionally by IdentityProvider
---
This method authenticates a customer with OAuth, Facebook, Google, Apple, or Synerise.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
**Declared In:**  
Headers/SNRClient.h
  
**Related To:**  
[ClientConditionalAuthResult](/developers/mobile-sdk/class-reference/ios/client#clientconditionalauthresult)  
[ClientIdentityProvider](/developers/mobile-sdk/class-reference/ios/client#clientidentityprovider)
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1029">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1029-0" data-tab-group="tabgrp-1029" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1029-1" data-tab-group="tabgrp-1029">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1029-0" data-tab-group="tabgrp-1029" data-tab-active="true">

```Swift
static func authenticateConditionally(token: AnyObject, clientIdentityProvider: ClientIdentityProvider, authID: String?, context: ClientConditionalAuthenticationContext?, success: ((ClientAuthenticationResult) -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1029-1" data-tab-group="tabgrp-1029">

```Objective-C
+ (void)authenticateConditionallyWithToken:(id)token clientIdentityProvider:(SNRClientIdentityProvider)clientIdentityProvider authID:(nullable NSString *)authID context:(nullable SNRClientConditionalAuthenticationContext *)context success:(void (^)(SNRClientAuthenticationResult *authenticationResult))success failure:(void (^)(SNRApiError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **token** | AnyObject | yes | - | Token retrieved from provider |
| **clientIdentityProvider** | [ClientIdentityProvider](/developers/mobile-sdk/class-reference/ios/client#clientidentityprovider) | yes | - | Provider of your token |
| **authID** | String | no | nil | Optional identifier of authorization |
| **context** | [ClientConditionalAuthenticationContext](/developers/mobile-sdk/class-reference/ios/client#clientconditionalauthenticationcontext) | no | nil | Object which contains agreements and attributes |
| **success** | (([ClientConditionalAuthResult](/developers/mobile-sdk/class-reference/ios/client#clientconditionalauthenticationcontext)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1030">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1030-0" data-tab-group="tabgrp-1030" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1030-1" data-tab-group="tabgrp-1030">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1030-0" data-tab-group="tabgrp-1030" data-tab-active="true">

```Swift
let agreements: ClientAgreements = ClientAgreements()
agreements.email = true
agreements.sms = true
agreements.push = true
agreements.bluetooth = true
agreements.rfid = true
agreements.wifi = true
let context: ClientConditionalAuthenticationContext = ClientConditionalAuthenticationContext()
context.agreements = agreements
context.attributes = ["attribute1": "value1", "attribute2": "value2"]
let accessToken: String = "ACCESS_TOKEN"
let authID: String = "AUTH_ID"
Client.authenticateConditionally(token: token, authID: authID, context: context, success: { (success) in
  // success
}) { (error) in
  // failure   
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1030-1" data-tab-group="tabgrp-1030">

```Objective-C
SNRClientAgreements *agreements = [SNRClientAgreements new];
agreements.email = true;
agreements.sms = true;
agreements.push = true;
agreements.bluetooth = true;
agreements.rfid = true;
agreements.wifi = true;
SNRClientConditionalAuthenticationContext *context = [SNRClientConditionalAuthenticationContext new];
context.agreements = agreements;
context.attributes = @{"attribute1": "value1", "attribute2": "value2"};
NSString *accessToken = @"ACCESS_TOKEN";
NSString *authID = @"AUTH_ID";
[SNRClient authenticateConditionallyWithToken:token authID:authID context:context success:^(BOOL isSuccess) {
  // success
} failure:^(SNRApiError *error) {
  // failure  
}];
```

</div>
</div>


## Authenticate customer with token payload
---
This method signs in a customer in with the provided token payload.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.15.0 | 5.15.0 | n/a | n/a |
**Declared In:**  
Headers/SNRClient.h
  
**Related To:**  
[TokenPayload](/developers/mobile-sdk/class-reference/ios/client#tokenpayload)  
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1031">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1031-0" data-tab-group="tabgrp-1031" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1031-1" data-tab-group="tabgrp-1031">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1031-0" data-tab-group="tabgrp-1031" data-tab-active="true">

```Swift
static func authenticate(tokenPayload: TokenPayload, authID: String, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1031-1" data-tab-group="tabgrp-1031">

```Objective-C
+ (void)authenticateWithTokenPayload:(SNRTokenPayload *)tokenPayload authID:(NSString *)authID success:(void (^)(void))success failure:(void (^)(SNRApiError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **tokenPayload** | [TokenPayload](/developers/mobile-sdk/class-reference/ios/client#tokenpayload) | yes | - | Object which contains a token's payload |
| **authID** | String | yes | - | Required customer's identifier of authorization |
| **success** | (() -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authID** parameter is used for decreasion the number of UUID refreshes so it must be unique for every customer.

</div></div></div>

  
**Return Value:**  
No value is returned.

## Authenticate customer via Simple Profile Authentication
---
This method authenticates a customer with Simple Profile Authentication.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.14.0 | 5.7.1 | 0.15.0 | 0.7.0 |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

When you use this method, you must set a request validation salt by using the `Synerise.setRequestValidationSalt(_:)` method (if salt is enabled for Simple Profile Authentication).

</div></div></div>



<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

The API key must have the `SAUTH_SIMPLE_AUTH_CREATE` from the **Auth** group.

</div></div></div>

**Declared In:**  
Headers/SNRClient.h
  
**Related To:**  
[ClientSimpleAuthenticationData](/developers/mobile-sdk/class-reference/ios/client#clientsimpleauthenticationdata)  
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1032">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1032-0" data-tab-group="tabgrp-1032" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1032-1" data-tab-group="tabgrp-1032">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1032-0" data-tab-group="tabgrp-1032" data-tab-active="true">

```Swift
static func simpleAuthentication(data: ClientSimpleAuthenticationData, authID: String, success: (() -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1032-1" data-tab-group="tabgrp-1032">

```Objective-C
+ (void)simpleAuthentication:(SNRClientSimpleAuthenticationData *)data authID:(NSString *)authID success:(void (^)(void))success failure:(void (^)(SNRApiError *error))failure
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **data** | [ClientSimpleAuthenticationData](/developers/mobile-sdk/class-reference/ios/client#clientsimpleauthenticationdata) | yes | - | Object which contains customer data |
| **authID** | String | yes | - | Required identifier of authorization |
| **success** | (() -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>

  
**Return Value:**  
No value is returned.

## Check if a customer is signed in (via RaaS, OAuth, Facebook, Apple)
---
This method checks if a customer is signed in (via Synerise Authentication - RaaS, OAuth, Facebook, Apple).
**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)

**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1033">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1033-0" data-tab-group="tabgrp-1033" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1033-1" data-tab-group="tabgrp-1033">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1033-0" data-tab-group="tabgrp-1033" data-tab-active="true">

```Swift
static func isSignedIn() -> Bool
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1033-1" data-tab-group="tabgrp-1033">

```Objective-C
+ (BOOL)isSignedIn
```

</div>
</div>

  
**Return Value:**  
**true** if the customer is signed in, otherwise returns **false**.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1034">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1034-0" data-tab-group="tabgrp-1034" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1034-1" data-tab-group="tabgrp-1034">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1034-0" data-tab-group="tabgrp-1034" data-tab-active="true">

```Swift
let isSignedIn: Bool = Client.isSignedIn()
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1034-1" data-tab-group="tabgrp-1034">

```Objective-C
BOOL isSignedIn = [SNRClient isSignedIn];
```

</div>
</div>


## Check if a customer is signed in (via Simple Profile Authentication)
---
This method checks if a customer is signed in (via Simple Profile Authentication).
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.14.0 | 5.7.1 | 0.15.0 | 0.7.0 |
**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1035">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1035-0" data-tab-group="tabgrp-1035" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1035-1" data-tab-group="tabgrp-1035">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1035-0" data-tab-group="tabgrp-1035" data-tab-active="true">

```Swift
static func isSignedInViaSimpleAuthentication() -> Bool
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1035-1" data-tab-group="tabgrp-1035">

```Objective-C
+ (BOOL)isSignedInViaSimpleAuthentication
```

</div>
</div>

    
**Return Value:**  
**true** if the customer is signed in (via Simple Profile Authentication), otherwise returns **false**.

## Sign out customer
---
This method signs out a customer out.
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This method works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).

</div></div></div>

**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1036">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1036-0" data-tab-group="tabgrp-1036" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1036-1" data-tab-group="tabgrp-1036">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1036-0" data-tab-group="tabgrp-1036" data-tab-active="true">

```Swift
static func signOut() -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1036-1" data-tab-group="tabgrp-1036">

```Objective-C
+ (void)signOut
```

</div>
</div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1037">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1037-0" data-tab-group="tabgrp-1037" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1037-1" data-tab-group="tabgrp-1037">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1037-0" data-tab-group="tabgrp-1037" data-tab-active="true">

```Swift
Client.signOut()
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1037-1" data-tab-group="tabgrp-1037">

```Objective-C
[SNRClient signOut];
```

</div>
</div>


## Sign out customer with mode or from all devices
---
This method signs out a customer out with a chosen mode and Determines if the method should sign out all devices.

Available modes:
- `.signOut` mode signs out the customer.
- `.signOutWithSessionDestroy` mode signs out the customer and additionally, clears the anonymous session and regenerates the customer UUID.

The `fromAllDevices` parameter determines whether the method should notify the backend to sign out all devices.

**IMPORTANT: It is an asynchronous method.**
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.11.0 | 5.1.0 | 0.14.0 | 1.0.0 |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This method works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).

</div></div></div>

**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1038">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1038-0" data-tab-group="tabgrp-1038" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1038-1" data-tab-group="tabgrp-1038">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1038-0" data-tab-group="tabgrp-1038" data-tab-active="true">

```Swift
static func signOut(mode: ClientSignOutMode, fromAllDevices: Bool, success: ((Bool) -> Void), failure: ((ApiError) -> Void))
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1038-1" data-tab-group="tabgrp-1038">

```Objective-C
+ (void)signOutWithmode:(SNRClientSignOutMode)mode fromAllDevices:(BOOL)fromAllDevices success:(void (^)(void))success failure:(void (^)(SNRApiError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **mode** | [ClientSignOutMode](/developers/mobile-sdk/class-reference/ios/client#clientsignoutmode) | yes | - | Mode of signing out |
| **fromAllDevices** | Bool | yes | - | Determines if the method should sign out all devices |
| **success** | (() -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |

**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1039">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1039-0" data-tab-group="tabgrp-1039" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1039-1" data-tab-group="tabgrp-1039">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1039-0" data-tab-group="tabgrp-1039" data-tab-active="true">

```Swift
Client.signOut(mode: .signOutWithSessionDestroy, fromAllDevices: true, success: {
  // success        
}) { (error) in
  // failure
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1039-1" data-tab-group="tabgrp-1039">

```Objective-C
[SNRClient signOutWithMode:SNRClientSignOutModeSignOutWithSessionDestroy fromAllDevices:YES success:^{
  // success     
} failure:^(SNRApiError *error) {
  // failure
}];
```

</div>
</div>


## Removed methods

### <del>Authenticate customer by OAuth with registration</del> {#authenticate-customer-by-oauth-with-registration}
---
This method authenticates a customer with OAuth.
  
If an account for the customer does not exist, this request creates an account.
  
| Available on | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 401 status code if the provided access token and/or API Key is invalid.

</div></div></div>

**Replaced By:**  
[Authenticate customer by IdentityProvider](/developers/mobile-sdk/method-reference/ios/client-authentication#authenticate-customer-by-identityprovider)

**Declared In:**  
Headers/SNRClient.h
  
**Related To:**  
[ClientOAuthAuthenticationContext](/developers/mobile-sdk/class-reference/ios/client#clientoauthauthenticationcontext)  
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1040">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1040-0" data-tab-group="tabgrp-1040" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1040-1" data-tab-group="tabgrp-1040">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1040-0" data-tab-group="tabgrp-1040" data-tab-active="true">

```Swift
static func authenticateByOAuth(accessToken: String, authID: String?, context: ClientOAuthAuthenticationContext?, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1040-1" data-tab-group="tabgrp-1040">

```Objective-C
+ (void)authenticateByOAuthWithAccessToken:(NSString *)accessToken authID:(nullable NSString *)authID context:(nullable SNRClientOAuthAuthenticationContext *)context success:(nullable void (^)(BOOL isSuccess))success failure:(nullable void (^)(NSError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **accessToken** | String | yes | - | OAuth Access Token |
| **authID** | String | no | nil | Optional identifier of authorization |
| **context** | [ClientOAuthAuthenticationContext](/developers/mobile-sdk/class-reference/ios/client#clientoauthauthenticationcontext) | no | nil | Object which contains agreements and attributes |
| **success** | ((Bool) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1041">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1041-0" data-tab-group="tabgrp-1041" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1041-1" data-tab-group="tabgrp-1041">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1041-0" data-tab-group="tabgrp-1041" data-tab-active="true">

```Swift
let agreements: ClientAgreements = ClientAgreements()
agreements.email = true
agreements.sms = true
agreements.push = true
agreements.bluetooth = true
agreements.rfid = true
agreements.wifi = true
let context: ClientOAuthContext = ClientOAuthContext()
context.agreements = agreements
context.attributes = ["attribute1": "value1", "attribute2": "value2"]
let accessToken: String = "ACCESS_TOKEN"
let authID: String = "AUTH_ID"
Client.authenticateByOAuth(accessToken: accessToken, authID: authID, context: context, success: { (success) in
  // success
}) { (error) in
  // failure   
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1041-1" data-tab-group="tabgrp-1041">

```Objective-C
SNRClientAgreements *agreements = [SNRClientAgreements new];
agreements.email = true;
agreements.sms = true;
agreements.push = true;
agreements.bluetooth = true;
agreements.rfid = true;
agreements.wifi = true;
SNRClientOAuthContext *context = [SNRClientOAuthContext new];
context.agreements = agreements;
context.attributes = @{"attribute1": "value1", "attribute2": "value2"};
NSString *accessToken = @"ACCESS_TOKEN";
NSString *authID = @"AUTH_ID";
[SNRClient authenticateByOAuthWithAccessToken:accessToken authID:authID context:context success:^(BOOL isSuccess) {
  // success
} failure:^(SNRApiError *error) {
  // failure  
}];
```

</div>
</div>


### <del>Authenticate customer by OAuth without registration</del> {#authenticate-customer-by-oauth-without-registration}
---
This method authenticates a customer with OAuth.
  
| Available on | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 401 status code if the provided access token and/or API Key is invalid.

</div></div></div>

**Replaced By:**  
[Authenticate customer conditionally by IdentityProvider](/developers/mobile-sdk/method-reference/ios/client-authentication#authenticate-customer-conditionally-by-identityprovider)

**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1042">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1042-0" data-tab-group="tabgrp-1042" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1042-1" data-tab-group="tabgrp-1042">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1042-0" data-tab-group="tabgrp-1042" data-tab-active="true">

```Swift
static func authenticateByOAuthIfRegistered(accessToken: String, authID: String?, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1042-1" data-tab-group="tabgrp-1042">

```Objective-C
+ (void)authenticateByOAuthIfRegisteredWithAccessToken:(nonnull NSString *)accessToken authID:(nullable NSString *)authID success:(nonnull void (^)(BOOL isSuccess))success failure:(nonnull void (^)(NSError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **accessToken** | String | yes | - | OAuth Access Token |
| **authID** | String | no | nil | Optional identifier of authorization |
| **success** | ((Bool) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>

  
**Return Value:**  
No value is returned.

### <del>Authenticate customer by Facebook with registration</del> {#authenticate-customer-by-facebook-with-registration}
---
This method authenticates a customer with Facebook.
  
If an account for the customer does not exist, this request creates an account.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.3.8 | 3.3.0 | 0.9.7 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 401 status code if the provided Facebook token and/or API Key is invalid.

</div></div></div>

**Replaced By:**  
[Authenticate customer by IdentityProvider](/developers/mobile-sdk/method-reference/ios/client-authentication#authenticate-customer-by-identityprovider)

**Declared In:**  
Headers/SNRClient.h
  
**Related To:**  
[ClientFacebookAuthenticationContext](/developers/mobile-sdk/class-reference/ios/client#clientfacebookauthenticationcontext)
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1043">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1043-0" data-tab-group="tabgrp-1043" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1043-1" data-tab-group="tabgrp-1043">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1043-0" data-tab-group="tabgrp-1043" data-tab-active="true">

```Swift
static func authenticateByFacebook(facebookToken: String, authID: String?, context: ClientFacebookAuthenticationContext?, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1043-1" data-tab-group="tabgrp-1043">

```Objective-C
+ (void)authenticateByFacebookWithFacebookToken:(nonnull NSString *)facebookToken authID:(nullable NSString *)authID context:(nullable SNRClientFacebookAuthenticationContext *)context success:(nonnull void (^)(BOOL isSuccess))success failure:(nonnull void (^)(NSError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **facebookToken** | String | yes | - | Facebook Access Token |
| **authID** | String | no | nil | Optional identifier of authorization |
| **context** | [ClientFacebookAuthenticationContext](/developers/mobile-sdk/class-reference/ios/client#clientfacebookauthenticationcontext) | no | nil | Object which contains agreements and attributes |
| **success** | ((Bool) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1044">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1044-0" data-tab-group="tabgrp-1044" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1044-1" data-tab-group="tabgrp-1044">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1044-0" data-tab-group="tabgrp-1044" data-tab-active="true">

```Swift
let agreements: ClientAgreements = ClientAgreements()
agreements.email = true
agreements.sms = true
agreements.push = true
agreements.bluetooth = true
agreements.rfid = true
agreements.wifi = true

let context: ClientFacebookAuthenticationContext = ClientFacebookAuthenticationContext()
context.agreements = agreements
context.attributes = ["attribute1": "value1", "attribute2": "value2"]

guard let facebookToken = FBSDKAccessToken.current()?.tokenString else {
    return
}
let authID: String = "AUTH_ID"

Client.authenticateByFacebook(facebookToken: fa, authID: authID, context: context, success: { (success) in
  // success
}) { (error) in
  // failure
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1044-1" data-tab-group="tabgrp-1044">

```Objective-C
SNRClientAgreements *agreements = [SNRClientAgreements new];
agreements.email = true;
agreements.sms = true;
agreements.push = true;
agreements.bluetooth = true;
agreements.rfid = true;
agreements.wifi = true;
SNRClientFacebookAuthenticationContext *context = [SNRClientFacebookAuthenticationContext new];
context.agreements = agreements;
context.attributes = @{"attribute1": "value1", "attribute2": "value2"};
NSString *facebookToken =  [FBSDKAccessToken currentAccessToken].tokenString;
NSString *authID = @"AUTH_ID";
[SNRClient authenticateByFacebookWithFacebookToken:facebookToken authID:authID context:context success:^(BOOL isSuccess) {
  // success
} failure:^(SNRApiError *error) {
  // failure  
}];
```

</div>
</div>


### <del>Authenticate customer by Facebook without registration</del> {#authenticate-customer-by-facebook-without-registration}
---
This method authenticates a customer with Facebook.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.3.8 | 3.3.0 | 0.9.7 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

Returns the HTTP 401 status code if the provided Facebook token and/or API Key is invalid.

</div></div></div>

**Replaced By:**  
[Authenticate customer conditionally by IdentityProvider](/developers/mobile-sdk/method-reference/ios/client-authentication#authenticate-customer-conditionally-by-identityprovider)

**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**   

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1045">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1045-0" data-tab-group="tabgrp-1045" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1045-1" data-tab-group="tabgrp-1045">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1045-0" data-tab-group="tabgrp-1045" data-tab-active="true">

```Swift
static func authenticateByFacebookIfRegistered(facebookToken: String, authID: String?, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1045-1" data-tab-group="tabgrp-1045">

```Objective-C
+ (void)authenticateByFacebookIfRegisteredWithFacebookToken:(nonnull NSString *)facebookToken authID:(nullable NSString *)authID success:(nonnull void (^)(BOOL isSuccess))success failure:(nonnull void (^)(NSError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **facebookToken** | String | yes | - | Facebook Access Token |
| **authID** | String | no | nil | Optional identifier of authorization |
| **success** | ((Bool) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1046">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1046-0" data-tab-group="tabgrp-1046" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1046-1" data-tab-group="tabgrp-1046">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1046-0" data-tab-group="tabgrp-1046" data-tab-active="true">

```Swift
guard let facebookToken = FBSDKAccessToken.current()?.tokenString else {
    return
}
let authID: String = "AUTH_ID"
Client.authenticateByFacebookIfRegistered(facebookToken: facebookToken, success: { (success) in
  // success
}, failure: { (error) in
  // failure
})
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1046-1" data-tab-group="tabgrp-1046">

```Objective-C
NSString *facebookToken =  [FBSDKAccessToken currentAccessToken].tokenString;
NSString *authID = @"AUTH_ID";
[SNRClient authenticateByFacebookIfRegisteredWithFacebookToken:facebookToken authID:authID success:^(BOOL isSuccess) {
  // success
} failure:^(SNRApiError *error) {
  // failure  
}];
```

</div>
</div>


### <del>Authenticate customer by Sign in with Apple with registration</del> {#authenticate-customer-by-sign-in-with-apple-with-registration}
---
This method authenticates a customer with Sign In With Apple.
  
If an account for the customer does not exist, this request creates an account.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.11 | n/a | 0.9.12 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | n/a | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | n/a | 1.0.0 | n/a |
**Replaced By:**  
[Authenticate customer by IdentityProvider](/developers/mobile-sdk/method-reference/ios/client-authentication#authenticate-customer-by-identityprovider)

**Declared In:**  
Headers/SNRClient.h
  
**Related To:**  
[ClientAppleSignInAuthenticationContext](/developers/mobile-sdk/class-reference/ios/client#clientapplesigninauthenticationcontext)  
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1047">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1047-0" data-tab-group="tabgrp-1047" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1047-1" data-tab-group="tabgrp-1047">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1047-0" data-tab-group="tabgrp-1047" data-tab-active="true">

```Swift
static func authenticateByAppleSignIn(identityToken: Data, authID: String?, context: ClientAppleSignInAuthenticationContext?, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1047-1" data-tab-group="tabgrp-1047">

```Objective-C
+ (void)authenticateByAppleSignInWithIdentityToken:(nonnull NSData *)identityToken authID:(nullable NSString *)authID context:(nullable SNRClientAppleSignInAuthenticationContext *)context success:(nonnull void (^)(BOOL isSuccess))success failure:(nonnull void (^)(NSError *error))failure
```

</div>
</div>


**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **identityToken** | Data | yes | - | Apple Identity Token |
| **context** | [ClientAppleSignInAuthenticationContext](/developers/mobile-sdk/class-reference/ios/client#clientapplesigninauthenticationcontext) | no | nil | Object which contains agreements and attributes |
| **authID** | String | no | nil | Optional identifier of authorization |
| **success** | ((Bool) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>

  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1048">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1048-0" data-tab-group="tabgrp-1048" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1048-1" data-tab-group="tabgrp-1048">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1048-0" data-tab-group="tabgrp-1048" data-tab-active="true">

```Swift
extension LoginViewController: ASAuthorizationControllerDelegate {
    func authorizationController(controller: ASAuthorizationController, didCompleteWithAuthorization authorization: ASAuthorization) {
        if let appleIDCredential = authorization.credential as? ASAuthorizationAppleIDCredential {
            let agreements: ClientAgreements = ClientAgreements()
            agreements.email = true
            agreements.sms = true
            agreements.push = true
            agreements.bluetooth = true
            agreements.rfid = true
            agreements.wifi = true
            let context: ClientAppleSignInAuthenticationContext = ClientAppleSignInAuthenticationContext(identityToken: appleIdCredential.identityToken!)
            context.agreements = agreements
            context.attributes = ["param": "value"]
            Client.authenticateByAppleSignIn(context: context, authID: authID, success: { (success) in
              // success
            }) { (error) in
              // failure
            }
        }
    }
}
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1048-1" data-tab-group="tabgrp-1048">

```Objective-C
#pragma mark - ASAuthorizationControllerDelegate

- (void)authorizationController:(ASAuthorizationController *)controller 
   didCompleteWithAuthorization:(ASAuthorization *)authorization {
       id credential = authorization.credential;
    if (credential != nil) {
        SNRClientAgreements *agreements = [SNRClientAgreements new];
        agreements.email = true;
        agreements.sms = true;
        agreements.push = true;
        agreements.bluetooth = true;
        agreements.rfid = true;
        agreements.wifi = true;
        SNRClientAppleSignInAuthenticationContext*context = [[SNRClientAppleSignInAuthenticationContext alloc] initWithIdentityToken:credential.identityToken];
        context.agreements = agreements;
        context.attributes = @{"attribute1": "value1", "attribute2": "value2"};
        [SNRClient authenticateByAppleSignInWithContext:context authID:authID success:^(BOOL isSuccess) {
          // success
        } failure:^(SNRApiError *error) {
          // failure  
        }];
    }
}
```

</div>
</div>


### <del>Authenticate customer by Sign in with Apple without registration</del> {#authenticate-customer-by-sign-in-with-apple-without-registration}
---
This method authenticates a customer with Sign In With Apple.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 3.6.11 | 3.6.13 | 0.9.12 | n/a |
| <span style="color:orange">Deprecated in:</span> | 3.7.6 | 3.8.0 | 0.9.19 | n/a |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 1.0.0 | n/a |
**Replaced By:**  
[Authenticate customer conditionally by IdentityProvider](/developers/mobile-sdk/method-reference/ios/client-authentication#authenticate-customer-conditionally-by-identityprovider)

**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1049">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1049-0" data-tab-group="tabgrp-1049" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1049-1" data-tab-group="tabgrp-1049">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1049-0" data-tab-group="tabgrp-1049" data-tab-active="true">

```Swift
static func authenticateByAppleSignInIfRegistered(identityToken: String, authID: String?, success: ((Bool) -> Void), failure: ((ApiError) -> Void)) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1049-1" data-tab-group="tabgrp-1049">

```Objective-C
+ (void)authenticateByAppleSignInIfRegisteredWithIdentityToken:(nonnull NSData *)identityToken authID:(nullable NSString *)authID success:(nonnull void (^)(BOOL isSuccess))success failure:(nonnull void (^)(NSError *error))failure
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **identityToken** | String | yes | - | Apple Identity Token |
| **authID** | String | no | nil | Optional identifier of authorization |
| **success** | ((Bool) -> Void) | yes | - | Closure/Block to be executed when the operation is completed successfully |
| **failure** | (([ApiError](/developers/mobile-sdk/class-reference/ios/miscellaneous#snrapierror)) -> Void) | yes | - | Closure/Block to be executed when the operation is completed with an error |
  

<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

**authID** parameter is used for decreasing the number of UUID refreshes, so it must be unique for every customer.

</div></div></div>

  
**Return Value:**  
No value is returned.

### <del>Sign out customer with mode</del> {#sign-out-customer-with-mode}
---
This method signs out a customer out with a chosen mode:
- `.signOut` mode notifies the backend that the customer is signed out.
- `.signOutWithSessionDestroy` mode notifies the backend that the customer is signed out and additionally, clears the anonymous session and regenerates the customer UUID.
  
| | **iOS SDK** | **Android SDK** | **React Native SDK** | **Flutter SDK** |
| --- | --- | --- | --- | --- |
| <span style="color:green">Introduced in:</span> | 4.4.0 | 4.6.0 | 0.12.0 | 0.7.0 |
| <span style="color:orange">Deprecated in:</span> | 4.11.0 | 5.1.0 | - | - |
| <span style="color:red">Removed in:</span> | 5.0.0 | 6.0.0 | 0.14.0 | 1.0.0 |


<div class="admonition admonition-note"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

This method works with every authentication type (via Synerise, External Provider, OAuth or Simple Profile Authentication).

</div></div></div>

**Replaced By:**  
[Sign out with mode or from all devices](/developers/mobile-sdk/method-reference/ios/client-authentication#sign-out-customer-with-mode-or-from-all-devices)
  
**Declared In:**  
Headers/SNRClient.h
  
**Class:**  
[Client](/developers/mobile-sdk/class-reference/ios/modules#client)
  
**Declaration:**  

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1050">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1050-0" data-tab-group="tabgrp-1050" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1050-1" data-tab-group="tabgrp-1050">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1050-0" data-tab-group="tabgrp-1050" data-tab-active="true">

```Swift
static func signOut(mode: ClientSignOutMode) -> Void
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1050-1" data-tab-group="tabgrp-1050">

```Objective-C
+ (void)signOutWithmode:(SNRClientSignOutMode)mode
```

</div>
</div>

  
**Parameters:**  
| Parameter | Type | Mandatory | Default | Description |
| --- | --- | --- | --- | --- |
| **mode** | [ClientSignOutMode](/developers/mobile-sdk/class-reference/ios/client#clientsignoutmode) | yes | - | Mode of signing out |
  
**Return Value:**  
No value is returned.
  
**Example:**

<div class="content-tabs code-tabs" data-tab-group="tabgrp-1051">
<div class="tab-buttons"><button class="tab-button" data-tab-id="tabgrp-1051-0" data-tab-group="tabgrp-1051" data-tab-active="true">Swift</button><button class="tab-button" data-tab-id="tabgrp-1051-1" data-tab-group="tabgrp-1051">Objective-C</button></div>

<div class="tab-panel" data-tab-id="tabgrp-1051-0" data-tab-group="tabgrp-1051" data-tab-active="true">

```Swift
Client.signOut(mode: .signOutWithSessionDestroy)
```

</div>

<div class="tab-panel" data-tab-id="tabgrp-1051-1" data-tab-group="tabgrp-1051">

```Objective-C
[SNRClient signOutWithMode:SNRClientSignOutModeSignOutWithSessionDestroy];
```

</div>
</div>
