Skip to content

API Returning HTML Instead of JSON - CodePush Update Checks Failing #29

@saqlain0007

Description

@saqlain0007

Hello RevoPush Team,

We're experiencing a critical issue with @revopush/react-native-code-push v1.5.0 where the mobile app cannot fetch CodePush updates because your API is returning HTML instead of JSON.

Environment Details

  • Library Version: @revopush/react-native-code-push v1.5.0
  • React Native Version: 0.75.5
  • App Name: Cialfo App
  • Deployment: Staging
  • Deployment Key: oCWs5JBRdArDYVGhyqewKPQH0vNTEJ2G2eqsGg
  • App Versions: iOS 4.3.30, Android 4.3.38
  • Server URL: https://app.revopush.org

The Problem

When the mobile app tries to check for updates, all API requests to https://app.revopush.org/v0.1/public/codepush/update_check return HTML (web UI page) instead of JSON, causing the following errors:

[CodePush] JSON Parse error: Unrecognized token '<'
CodePush: An unknown error occurred

API Test Results

Test 1: GET Request

curl "https://app.revopush.org/v0.1/public/codepush/update_check?deploymentKey=oCWs5JBRdArDYVGhyqewKPQH0vNTEJ2G2eqsGg&appVersion=4.3.30&label=&packageHash=&isCompanion=false&clientUniqueId=test"

Response:

  • Status: HTTP 200 OK
  • Content-Type: text/html; charset=utf-8 ❌ (Expected: application/json)
  • Body: HTML page (Revopush web UI)

Test 2: POST Request

curl -X POST "https://app.revopush.org/v0.1/public/codepush/update_check" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"deploymentKey":"oCWs5JBRdArDYVGhyqewKPQH0vNTEJ2G2eqsGg","appVersion":"4.3.30"}'

Response:

  • Status: HTTP 405 Method Not Allowed ❌

What Works ✅

  1. CLI deployment: revopush release-react "Cialfo App" ios --deploymentName Staging works perfectly
  2. Dashboard: Release v41 appears correctly in the RevoPush dashboard
  3. CLI commands: revopush deployment list "Cialfo App" shows deployments correctly
  4. Update exists: Release v41, App Version 4.3.30, deployed successfully

What Doesn't Work ❌

  1. Mobile app update checks: API returns HTML instead of JSON
  2. Native SDK requests: @revopush/react-native-code-push library cannot parse HTML responses

Expected vs Actual Behavior

Expected API Response:

{
  "updateInfo": {
    "isAvailable": true,
    "appVersion": "4.3.30",
    "label": "v41",
    "downloadUrl": "https://...",
    "description": "iOS Staging Update for v4.3.30",
    "isMandatory": false,
    "packageSize": 23150000
  }
}

Actual API Response:

<!doctype html>
<html lang="en">
  <head>
    <title>Revopush</title>
    ...
  </head>
  <body>
    <!-- Web UI HTML -->
  </body>
</html>

Questions for RevoPush Team

  1. Is the API endpoint correct? Should we use a different endpoint for v1.5.0?
  2. Are there required authentication headers beyond the deployment key?
  3. Is there a known issue with v1.5.0 and the current API?
  4. Should we use GET or POST? Tests show GET returns HTML and POST returns 405
  5. Is there API documentation for the update_check endpoint?

Impact

Our production mobile app (4.3.38 Android, 4.3.30 iOS) cannot receive OTA updates, affecting our ability to deploy bug fixes and features without app store releases.

Our Configuration

We've verified all our configuration is correct:

  • ✅ Deployment keys match dashboard
  • ✅ Server URL: https://app.revopush.org
  • ✅ Native iOS configuration (Info.plist with CodePushDeploymentKey and CodePushServerURL)
  • ✅ Native Android configuration (strings.xml with CodePushDeploymentKey and CodePushServerUrl)
  • ✅ JavaScript configuration correct
  • ✅ Environment variables loading properly

This appears to be a server-side routing or API compatibility issue. The API endpoint is returning the web application instead of the REST API response.

Request

Please investigate why the /v0.1/public/codepush/update_check endpoint is returning HTML instead of JSON, and provide guidance on:

  1. The correct API endpoint format for @revopush/react-native-code-push v1.5.0
  2. Required headers or authentication
  3. Whether we need to upgrade the library
  4. Any server-side issues you're aware of

Thank you for your help!


Muhammad Saqlain
muhammadsaqlain.qazi@cialfo.com.sg
Cialfo

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