Skip to content

Support appId/appKey options for uploadIpa/uploadApk or configurable update.json path #67

Description

@binlvtop

Problem

cresc uploadIpa and cresc uploadApk currently resolve the target app from top-level update.json[platform].

This works for one app record per platform, for example:

{
  "ios": { "appId": 11, "appKey": "***" },
  "android": { "appId": 12, "appKey": "***" }
}

But it is hard to support package/channel isolation where test and release packages must upload native baselines to different app records:

{
  "test": {
    "ios": { "appId": 27, "appKey": "***" },
    "android": { "appId": 26, "appKey": "***" }
  },
  "release": {
    "ios": { "appId": 11, "appKey": "***" },
    "android": { "appId": 12, "appKey": "***" }
  }
}

In this setup, the app runtime can choose the correct appKey by package type, but the CLI native upload command still only recognizes the top-level platform keys.

Current workaround

Before running native baseline upload, we need to temporarily generate or rewrite update.json into the top-level shape expected by the CLI:

{
  "ios": { "appId": 27, "appKey": "***" }
}

Then run:

cresc uploadIpa build.ipa --version 4.3.2-test.18

This works, but it is fragile in CI because update.json is both runtime config and CLI config.

Proposed solutions

One of these would solve the issue:

Option 1: expose appId/appKey on upload commands

cresc uploadIpa build.ipa --appId 27 --appKey xxx --version 4.3.2-test.18
cresc uploadApk build.apk --appId 26 --appKey xxx --version 4.3.2-test.18

Option 2: support a config path

cresc uploadIpa build.ipa --config update.test.json --version 4.3.2-test.18

Option 3: support channel/package selection

cresc uploadIpa build.ipa --channel test --version 4.3.2-test.18

Then CLI could resolve:

updateConfig[channel][platform]

Implementation note

In react-native-update-cli@2.16.0, the internal native package upload code appears to already accept appId and appKey options, but the binary CLI command definitions for uploadIpa and uploadApk do not expose those options.

So exposing --appId and --appKey on these commands may be the smallest compatible change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions