2

I am setting up code-push for my app and found a weird behaviour. I compiled the app for staging and installed it on the android phone and then pushed some updates through code-push which were downloaded fine.

I am not changing the versions of my apk in android/app/build.gradle since i am installing directly from the mac to the phone for testing in staging mode and it overrides the previous installation.

I keep track of the bundle-id for bugsnag and the last bundle-id for code-push is 1.6.5. After some more modifications I ended up creating a new apk for staging that was installed and now the bundle-id is 1.6.7. I haven't pushed this to code-push yet. As soon as the app runs it asks for an update and if I update i get the old bundle (bundle-id 1.6.5) from code-push. Not able to understand why i will get old code as an update. Am i not setting some parameter correctly?

react-native: 0.44.1

react-native-code-push: 2.1.1-beta

Aman Agarwal
  • 589
  • 1
  • 4
  • 22

1 Answers1

0

You have to push the package to code push and make it available for 1.6.7 version so that it downloads the new package instead of the old one. You can make the release mandatory and tell code push to download it and update it on next resume like so codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME, installMode: codePush.InstallMode.ON_NEXT_RESUME })

Alexander Vitanov
  • 4,074
  • 2
  • 19
  • 22
  • 2
    From what i understand if i am compiling a new binary i shouldn't have to push an update to codepush as the new binary has the latest code and codepush should not be pushing an old code in any case. I think this has to to do with the app versions being same and not updated as I am testing locally on staging without changing the app version so codepush detects the old app version has an update which in this example has code-bundle-id as 1.6.5 even though the latest code-bundle-id is 1.6.7 but the app versions is 1.5.0 (the versioncode set in build.gradle) – Aman Agarwal Oct 08 '17 at 15:20