because the readme does not mention how to setup the private serverUrl , so I try to find out where is the problem block working .
ohh , I forgot the serverUrl
1銆乤ndroid/app/src/main/res/values/strings.xml
add <string moduleConfig="true" name="serverUrl">https://xxx.com</string>
2銆乶ode_modules/react-native-code-push/package.json
add BuildConfig.DEBUG,getResources().getString(R.string.serverUrl) to the new CodePush func.
like this below
"rnpm": {
"android": {
"packageInstance": "new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG,getResources().getString(R.string.serverUrl))"
}
cool!
because the readme does not mention how to setup the private serverUrl , so I try to find out where is the problem block working .
ohh , I forgot the serverUrl
1銆乤ndroid/app/src/main/res/values/strings.xml
add<string moduleConfig="true" name="serverUrl">https://xxx.com</string>
2銆乶ode_modules/react-native-code-push/package.json
add BuildConfig.DEBUG,getResources().getString(R.string.serverUrl) to the new CodePush func.
like this below
"rnpm": {
"android": {
"packageInstance": "new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG,getResources().getString(R.string.serverUrl))"
}
cool!
or do it like this, set postinstall in your project's package.json file.
...
"scripts": {
"postinstall": "sed -ig 's/new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG)/new CodePush(getResources().getString(R.string.reactNativeCodePush_androidDeploymentKey), getApplicationContext(), BuildConfig.DEBUG, "YOUR_SERVER_URL")/g' node_modules/react-native-code-push/package.json",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
...
Most helpful comment
or do it like this, set
postinstallin your project's package.json file.