Skip to content

Feature Request: Public API to Override Application Version for Native iOS Apps #2585

Description

@blimmer

Feature Description

Current Behavior:
The DataDog iOS SDK automatically determines the application version from the bundle's CFBundleShortVersionString or CFBundleVersion. There is currently no documented, supported public API for native iOS applications to override this version string.

Desired Behavior:
Provide a public, documented way for native iOS apps to set a custom application version that will be reported to DataDog, enabling use cases like:

  • Identifying TestFlight builds with build numbers (e.g., 1.0.0-1234)
  • Differentiating between app variants using the same bundle version

Use Case:
We want to identify TestFlight builds in DataDog with their full build information (e.g., 1.0.0-<BUILD_NUMBER>) to better correlate logs and errors with specific TestFlight releases. Currently, only the bundle's short version string appears in DataDog, making it difficult to distinguish between multiple TestFlight builds of the same version.

Current Situation

While researching this issue, I discovered the version can technically be overridden, but only through internal, unsupported APIs:

  1. additionalConfiguration[CrossPlatformAttributes.version] - This approach is explicitly internal-only (confirmed in #2281 where the team stated: "additionalConfiguration is intentionally internal and designed for cross-platform SDKs only")

  2. DatadogCore.set(customVersion:) - This method exists but includes an explicit warning in the code:

    /// This extension exposes internal methods that are used by other Datadog modules and cross platform
    /// frameworks. It is not meant for public use.
    ///
    /// DO NOT USE this extension or its methods if you are not working on the internals of the Datadog SDK
    /// or one of the cross platform frameworks.
    ///
    /// Methods, members, and functionality of this class are subject to change without notice, as they
    /// are not considered part of the public interface of the Datadog SDK.

Result: Native iOS developers have no supported way to override the application version, even though the underlying functionality clearly exists for cross-platform SDKs.

Proposed Solution

Add a public version parameter to Datadog.Configuration:

Datadog.initialize(
    with: Datadog.Configuration(
        clientToken: "...",
        env: "production",
        version: "1.0.0-1234"  // ← New parameter
    ),
    trackingConsent: .granted
)

This would provide a clean, documented API that:

  • Follows the existing configuration pattern
  • Makes the capability discoverable through standard IDE autocomplete
  • Maintains backward compatibility (optional parameter with fallback to bundle version)

Other Relevant Information

  • This request is specifically for native iOS applications, distinct from the cross-platform SDK use cases
  • The version override functionality already exists internally (as evidenced by PR #973)
  • A similar capability exists for other attributes (build number was made public in PR #1465)
  • Having a documented public API would prevent developers from using unsupported internal APIs that may break in future releases

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions