# 기기 수신동의 관리

## 개요

마켓탭 SDK는 푸시 수신동의를 **유저 레벨**뿐 아니라 **기기 레벨**에서도 설정할 수 있습니다.

* 기기 레벨 수신동의는 설정한 **디바이스에만 적용**됩니다.
* 푸시 발송 시에는 **유저 수신동의 → 기기 수신동의** 순서로 함께 체크됩니다.

{% hint style="info" %}
수신동의 여부는 최초 수집 및 변경 시점 등 필요한 경우에 연동 가능합니다.
{% endhint %}

### 발송 조건

| 유저 수신동의 | 기기 수신동의 | 발송 여부 |
| ------- | ------- | ----- |
| null    | null    | 발송    |
| null    | true    | 발송    |
| null    | false   | 미발송   |
| true    | null    | 발송    |
| true    | true    | 발송    |
| true    | false   | 미발송   |
| false   | null    | 미발송   |

### 플랫폼별 설정법

{% hint style="warning" %}
웹뷰 브릿지 연동 후 js에서 setDeviceOptIn을 사용할 경우 모바일 sdk `1.3.1` 이상 버전에서만 동작합니다.
{% endhint %}

{% tabs %}
{% tab title="Android - Kotlin" %}

```kotlin
Marketap.setDeviceOptIn(true) // true | false | null
```

{% endtab %}

{% tab title="IOS - Swift" %}

```swift
Marketap.setDeviceOptIn(optIn: true) // true | false | nil
```

{% endtab %}

{% tab title="Flutter - Dart" %}

```dart
Marketap.setDeviceOptIn(true) // true | false | null
```

{% endtab %}

{% tab title="React Native - Typescript" %}

```typescript
Marketap.setDeviceOptIn(true) // true | false | null
```

{% endtab %}

{% tab title="Web - javascript" %}

```javascript
window.mtap.setDeviceOptIn(true)  // true | false | null
```

{% endtab %}
{% endtabs %}
