# App Data Migration detection (formerly Device Binding)

App Data Migration detection identifies situations where application data is restored, transferred, and reused on a different physical device. This behavior can indicate that sensitive application state, credentials, or tokens have been migrated outside the original environment.

{% hint style="warning" %}
A new install of the application (e.g. in case of buying a new device and transfer the apps) is not detected.
{% endhint %}

On iOS, **deviceID** detects whether the [device identifier](https://developer.apple.com/documentation/uikit/uidevice/1620059-identifierforvendor) has changed. It is triggered after the app is reinstalled if no other apps from the same vendor are installed. The value can also change when you install test builds with Xcode or distribute the app ad hoc.

Below are code snippets showing how this feature is reported across various platforms:

```dart
// Android device binding check
override fun onDeviceBindingDetected() {
    TODO("Not yet implemented")
}

// iOS device binding methods
case deviceChange
case deviceID

// Flutter 
// device binding and device change detection
onDeviceBinding: () => print("Device binding")

// device ID 
onDeviceID: () => print("Device ID")  // iOS only

// Cordova 
// device binding and device change detection
deviceBinding: () => {
    // Place your reaction here
}

// device ID 
deviceID: () => {  // iOS only
    // Place your reaction here 
}

// React Native 
// device binding and device change detection
deviceBinding: () => {
    // Place your reaction here
}

// deviceID
deviceID: () => {  // iOS only
    // Place your reaction here 
}

// Capacitor 
// device binding and device change detection
deviceBinding: () => {
    // Place your reaction here
}

// deviceID
deviceID: () => {  // iOS only
    // Place your reaction here 
}
```

{% hint style="info" %}
**Recommended action:** Log the event on your BE. Act on it if you need to keep an app instance tied to a specific device, such as during activation. Otherwise, you can ignore it.
{% endhint %}
