Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant):
in my index file
let codePushOptions = { checkFrequency: CodePush.CheckFrequency.MANUAL };
AppRegistry.registerComponent(appName, () => CodePush(codePushOptions)(App));
and in the app. have added the sync method in componentDidMount like this
CodePush.sync({
updateDialog: true,
installMode: CodePush.InstallMode.IMMEDIATE
}, this.codePushStatusDidChange.bind(this), this.codePushDownloadDidProgress.bind(this)
)
To Update code shown inside the app when the update arrives
What actually happens?
The code is updated when the app is opened the second time.
Here is the log
`[03:25:20] Expected hash: hashkey, actual hash: samehashkey
[03:25:20] The update contents succeeded the data integrity check.
[03:25:20] Verifying signature for folder path: /data/user/0/com.packagename/files/CodePush/somestring.
[03:25:20] JWT verification succeeded, payload content: {claimVersion=1.0.0, iat=Wed Oct 31 15:24:49 GMT+05:30 2018, contentHash=contenthash}
[03:25:20] The update contents succeeded the code signing check.
[03:25:20] Loading JS bundle from "/data/user/0/com.packagename/files/CodePush/someString/CodePush/index.android.bundle"
[03:25:20] Unable to set JSBundle - CodePush may not support this version of React Native
[03:25:20] Restarting app
when I manually close the app and restart
[03:31:06] Loading JS bundle from "/data/user/0/com.somepackage/files/CodePush/somestring/CodePush/index.android.bundle"
[03:31:07] Reporting CodePush update success (v10)
Hi @saranshagarwal ,
Thanks for reporting!
It looks like that you have some issue with setting bundle for IMMEDIATE but then it is set successfully after reloading.
Could you please provide some dummy project with repro steps? I would like to debug it.
Thanks,
Alexander
This would take some time since now I am working on a different version of react-native for my other projects(shifting version was a pain). I am adding the basic files that would reproduce this code in an empty project with react native version .56.0.
This url. contains two files. index.js and app,js Please check. Apologies for the inconvenience.If this causes trouble just let me know. Will create a project.
Thanks,
Saransh Agarwal
Sure, I'll try to reproduce issue with this example and let you know results.
Also, which approach have you used for installing CodePush? With link command or manual?
I have used the link command but made sure everything matched with the manual instructions
Hello @saranshagarwal,
I've created some simple app to test:
code-push app add Issue1442-android android react-nativereact-native init --version="0.56.0" Issue1442yarn add react-native-code-pushreact-native link react-native-code-push, pasted Staging deployment key for android.App.js with your version of this file, fixed it a little bit.bundleInDebug: true in ./android/app/build.gradle (to test the app in debug mode without a bundler)CodePush bundle! text (code-push release-react Issue1442-android android)Built in bundle!react-native run-android
You can check this demo app [here] (there is a README).
Can you test it and share the results with us?
Hi @saranshagarwal,
I'm going to close this issue for now as I haven't heard from you in a while, unfortunately.
Please feel free to reopen it if you have any questions.
Hello @saranshagarwal,
I've created some simple app to test:
code-push app add Issue1442-android android react-native- Copied Staging deployment key
react-native init --version="0.56.0" Issue1442yarn add react-native-code-pushreact-native link react-native-code-push, pasted Staging deployment key for android.- Replaced
App.jswith your version of this file, fixed it a little bit.- Added
bundleInDebug: truein./android/app/build.gradle(to test the app indebugmode without a bundler)- Made codepush release with
CodePush bundle!text (code-push release-react Issue1442-android android)- Replaced this text with
Built in bundle!react-native run-androidResult
You can check this demo app [here] (there is a README).
Can you test it and share the results with us?
Have you tried this with proguard enabled? App is not getting refreshed only when proguard is enabled. If it's false it changes automatically.
This issue resolved my problem.