Dan
Dan

Reputation: 8844

How to deploy CodePush bundle for multiple versions?

I have read about the targetBinary flag and I have also read this from a member of the Microsoft team working on CodePush.

I have version 5.0.1 and 5.1.0.

If a bug comes in for version 5.0.1, how do I fix it and deploy it for this version only? Bugs may be critical and not everyone will have the latest version of the app.

Or, the bug may only exist on a specific version.

Is my only option to:

This seems like a long-winded way of updating a version. Is there a more elegant way of managing this?

Upvotes: 13

Views: 13299

Answers (2)

Patrick Nikoletich
Patrick Nikoletich

Reputation: 436

The target binary version param supports ranges for this scenario. Here's a helpful table to guide you.

Range Expression    Who gets the update
----------------    ----------------------
1.2.3               Only devices running the specific binary app store version 1.2.3 of your app
*                   Any device configured to consume updates from your CodePush app
1.2.x               Devices running major version 1, minor version 2 and any patch version of your app
1.2.3 - 1.2.7       Devices running any binary version between 1.2.3 (inclusive) and 1.2.7 (inclusive)
>=1.2.3 <1.2.7      Devices running any binary version between 1.2.3 (inclusive) and 1.2.7 (exclusive)
1.2                 Equivalent to >=1.2.0 <1.3.0
~1.2.3              Equivalent to >=1.2.3 <1.3.0
^1.2.3              Equivalent to >=1.2.3 <2.0.0

Upvotes: 27

Sam Hoult
Sam Hoult

Reputation: 101

You can target a specific version with code push by choosing a different version using the target flag -t and the appcenter-cli

Target all versions of the app: appcenter codepush release-react -a Org/MyApp -t '*'

Target version 5.0.1 versions of the app: appcenter codepush release-react -a Org/MyApp -t '5.0.1'

Upvotes: 6

Related Questions