@sukraa/code-push
v1.0.1
Published
Sukraa React Native CodePush client that force-downloads updates from a local server
Downloads
303
Maintainers
Readme
@sukraa/code-push
React Native OTA client with force-download on open, plus a full platform (API + dashboard + CLI).
Default server: https://sukraa-code-push.onrender.com/
See PLATFORM.md for the complete system guide, including Windows server + domain.
Install in an RN app
npm install @sukraa/code-push
cd ios && pod install && cd ..import CodePush from "@sukraa/code-push";
CodePush.configure({
key: "cp_xxxxxxxxx",
serverUrl: "https://sukraa-code-push.onrender.com/"
});
class App extends Component {}
export default CodePush(App);Use a cp_… key from the dashboard. Keep the trailing slash on serverUrl.
Use http://127.0.0.1:3000/ only while the server runs on your own machine. On a real phone, use the Render URL above (or your own HTTPS domain).
If you omit serverUrl, the SDK already defaults to https://sukraa-code-push.onrender.com/ (JS, iOS, and Android).
Native wiring
iOS
AppDelegate release bundle:
return [CodePush bundleURL];Optional Info.plist fallbacks:
<key>CodePushDeploymentKey</key>
<string>cp_xxxxxxxxx</string>
<key>CodePushServerURL</key>
<string>https://sukraa-code-push.onrender.com/</string>Android
getJSBundleFile() → CodePush.getJSBundleFile()
strings.xml fallbacks:
<string name="CodePushDeploymentKey">cp_xxxxxxxxx</string>
<string name="CodePushServerUrl">https://sukraa-code-push.onrender.com/</string>apply from: "../../node_modules/@sukraa/code-push/android/codepush.gradle"
CLI release
npm install -g @sukraa/code-push-cli
sukraa-code-push login --server https://sukraa-code-push.onrender.com --email [email protected] --password secret
sukraa-code-push release --project com.patient_app --platform ios --app-version 1.0.0Reopen the app to force-download the new JS bundle.
