Returns the default secure device identifier as determined by the native platform.
The default identifier is platform-specific and provides a high level of cryptographic security:
This is the recommended method for most use cases. The identifier:
Android persistence:
iOS persistence:
Persists across app uninstalls and reinstalls (Keychain is not cleared when app is deleted)
Persists when device is restored from encrypted iCloud or local backup
Permanently deleted only on factory reset (entire device storage wiped)
Can be shared across apps from the same developer using Keychain Access Groups
Automatically migrates and preserves legacy identifiers from FRAuth, maintaining the original SHA-1 hash
Is unique per app and device
Uses platform-specific secure storage mechanisms
A promise that resolves to the default device identifier string
Promise rejections use DeviceIdError.
import { getDeviceId } from '@ping-identity/rn-device-id';// Get secure device identifier for authenticationconst deviceId = await getDeviceId();console.log('Device ID:', deviceId);// Output: "550e8400-e29b-41d4-a716-446655440000" Copy
import { getDeviceId } from '@ping-identity/rn-device-id';// Get secure device identifier for authenticationconst deviceId = await getDeviceId();console.log('Device ID:', deviceId);// Output: "550e8400-e29b-41d4-a716-446655440000"
Returns the default secure device identifier as determined by the native platform.
The default identifier is platform-specific and provides a high level of cryptographic security:
This is the recommended method for most use cases. The identifier:
Android persistence:
iOS persistence:
Persists across app uninstalls and reinstalls (Keychain is not cleared when app is deleted)
Persists when device is restored from encrypted iCloud or local backup
Permanently deleted only on factory reset (entire device storage wiped)
Can be shared across apps from the same developer using Keychain Access Groups
Automatically migrates and preserves legacy identifiers from FRAuth, maintaining the original SHA-1 hash
Is unique per app and device
Uses platform-specific secure storage mechanisms