Bit late with the answer, but sharing my 2 cents for anybody who is wondering -
In our production environment, we use the 4th digit to identify the codepush releases (and display this value in the settings page of our app). The appstore/playstore releases (as required) are in X.X.X
format, but the app UI displays X.X.X.X
.
When we are codepushing the update, we increment the 4th digit (it's stored in appconfig.js) , and after next store release we reset it back to 1. As the codepush releases can be targeting specific appstore/playstore release (using the -t option of CLI) , with this approach we can codepush latest update to recent store version and also a patch to previous version at the same time. Example:
Initial store version 1.0.0 => app settings page shows 1.0.0.1
- Codepush #1 ,
target 1.0.0
=> 1.0.0.2
- Codepush #2 ,
target 1.0.0
=> 1.0.0.3
Store release 1.0.1 => 1.0.1.1
- Codepush #3 , target
1.0.1
=> 1.0.1.2
- Patch Codepush #4 , target
1.0.0
=> 1.0.0.4
(apply patch to previous version to clients which didn't update yet to 1.0.1)
If for any reason we can't patch anymore previous versions (i.e. requirement of a new native module from latest version), we have a built in mechanism in the app to force everybody to update to latest store version (triggered remotely from server side) , in which case they will all get the latest codepush and we don't need to worry about backward compatibility.