Skip to content

[iOS] Qonversion SDK making requests to malformed URLs - missing API hostname #391

@lukeholmgren

Description

@lukeholmgren

Note: This issue was constructed with the assistance of AI analysis of native iOS logs.

Environment

  • Platform: iOS (all versions)
  • SDK Version: @qonversion/[email protected]
  • React Native: 0.81.5
  • Expo: 54.0.21

Description

The Qonversion SDK is attempting to make HTTP requests to incomplete/malformed URLs that are missing the API hostname. This causes DNS resolution failures on iOS.

Root Cause

The SDK is constructing URLs like:

  • https://v1/user/init
  • https://v3/users/QON_3ec1e2018a9a4c419b5c33dc59996f46/properties

Instead of properly formed URLs like:

  • https://api.qonversion.io/v1/user/init
  • https://api.qonversion.io/v3/users/QON_3ec1e2018a9a4c419b5c33dc59996f46/properties

Error Details

Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." NSErrorFailingURLStringKey=https://v1/user/init _NSURLErrorNWResolutionReportKey=Resolved 0 endpoints in 2ms using unknown from cache

The DNS resolver is unable to find a hostname for v1 because it's not a valid domain.

Stack Trace

Task .<2> HTTP load failed Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." NSErrorFailingURLStringKey=https://v1/user/init NSErrorFailingURLKey=https://v1/user/init

Reproduction Steps

  1. On any iOS device
  2. Call Qonversion.initialize() with valid project key
  3. Observe: Network error with malformed URLs in logs

Expected Behavior

The SDK should construct complete, valid URLs with the proper API hostname (e.g., api.qonversion.io).

Actual Behavior

The SDK constructs incomplete URLs missing the hostname, causing DNS resolution failures.

Key Observations

  • ✅ Works on Android (likely uses different URL construction or has fallback logic)
  • ❌ Fails on iOS (malformed URLs)
  • The issue is in the SDK's URL construction logic, not in the app's configuration
  • The project key and configuration are correct (user ID is generated: QON_3ec1e2018a9a4c419b5c33dc59996f46)

Possible Root Causes

  1. Missing API Base URL Configuration - The SDK may not be properly initializing the base URL for API requests
  2. Platform-Specific URL Construction - iOS implementation differs from Android
  3. Configuration Issue - Base URL not being set during initialization
  4. SDK Bug - URL construction logic is stripping the hostname

Workaround

None available - this is a critical SDK issue that prevents initialization entirely.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions