CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-expo-application

A universal module that gets native application information such as its ID, app name, and build version at runtime

Overall
score

98%

Overview
Eval results
Files

task.mdevals/scenario-8/

Device Identification Service

Build a simple device identification service for a React Native iOS application that retrieves and validates device identifiers.

Requirements

Your service should provide the following functionality:

Device Identifier Retrieval

The service must retrieve the iOS vendor identifier for the current device. The identifier should be returned as a string, or null if unavailable (for example, when the device has been restarted but not yet unlocked).

Identifier Validation

The service must validate that the retrieved identifier:

  • Is not null before using it
  • Follows the standard UUID format (8-4-4-4-12 hexadecimal pattern)
  • Contains only valid hexadecimal characters and hyphens

Error Handling

The service must handle platform-specific errors gracefully. If the identifier retrieval functionality is not available on the current platform, the service should catch and handle the error appropriately, returning a clear error status.

Test Cases

  • Retrieving a valid device identifier returns a non-null UUID string @test
  • A valid UUID string matches the UUID format pattern (8-4-4-4-12) @test
  • Attempting to retrieve identifier on an unsupported platform returns error status @test

Implementation

@generates

API

/**
 * Retrieves the iOS vendor identifier for the device
 * @returns Promise resolving to identifier string or null if unavailable
 */
export async function getDeviceIdentifier(): Promise<string | null>;

/**
 * Validates that a string follows UUID format (8-4-4-4-12 pattern)
 * @param identifier - The identifier string to validate
 * @returns true if valid UUID format, false otherwise
 */
export function isValidUuidFormat(identifier: string): boolean;

/**
 * Retrieves and validates the device identifier
 * @returns Promise resolving to object with identifier and validity status
 */
export async function getValidatedIdentifier(): Promise<{
  identifier: string | null;
  isValid: boolean;
  error?: string;
}>;

Dependencies { .dependencies }

expo-application { .dependency }

Provides access to native device identification functionality for iOS applications.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-expo-application

tile.json