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-6/

Build Type Feature Toggle System

Build a feature toggle system for a React Native mobile app that enables or disables certain features based on the iOS build type (e.g., development, simulator, app store release).

Requirements

Your task is to create a module that:

  1. Detects the iOS build distribution type when running on iOS devices
  2. Provides a function that determines if debug features should be enabled based on the build type
  3. Returns appropriate feature access information that can be used throughout the app

Expected Behavior

The system should identify whether the app is running in:

  • A simulator environment
  • A development build
  • An enterprise distribution
  • An ad-hoc distribution
  • An App Store release
  • Or if the type cannot be determined

Based on this information, the system should enable debug features only for simulator and development builds, while keeping them disabled for all distribution builds (enterprise, ad-hoc, and app store).

Platform Handling

  • On iOS: Detect the actual build type and make appropriate decisions
  • On Android and web: Return a safe default (debug features disabled)
  • Handle platform detection appropriately without throwing errors

Test Cases

  • When running on an iOS simulator, debug features should be enabled @test
  • When running on an iOS development build, debug features should be enabled @test
  • When running on an iOS App Store build, debug features should be disabled @test
  • When running on Android or web platforms, debug features should be disabled @test

Implementation

@generates

API

/**
 * Gets the current build type information
 * @returns Promise resolving to an object containing:
 *   - buildType: string describing the build type
 *   - debugFeaturesEnabled: boolean indicating if debug features should be active
 */
export async function getBuildInfo(): Promise<{
  buildType: string;
  debugFeaturesEnabled: boolean;
}>;

Dependencies { .dependencies }

expo-application { .dependency }

Provides native application information including iOS release type detection.

Install with Tessl CLI

npx tessl i tessl/npm-expo-application

tile.json