Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the android version download the bundles in spite of the number in metadata.android.json is greater #35

Open
spicylobster opened this issue May 20, 2016 · 0 comments

Comments

@spicylobster
Copy link

I provide metadata.android.json and the bundle file in the assets directory. The version in metadata is 1.1.0 and the version in update.json on the internet is 1.0.0. But when the app starts, it download the bundles and prompt to apply the update.

I explore some of the code. I think Both getLatestJSCodeLocation and shouldDownloadUpdate lead to update when the app first launch. But I'm not quite sure

public String getLatestJSCodeLocation() {
        SharedPreferences prefs = context.getSharedPreferences(RNAU_SHARED_PREFERENCES, Context.MODE_PRIVATE);
        String currentVersionStr = prefs.getString(RNAU_STORED_VERSION, null);

        Version currentVersion;
        try {
            currentVersion = new Version(currentVersionStr);  // when the app first launch is null
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
private boolean shouldDownloadUpdate(String versionStr, String minContainerVersionStr) {
        boolean shouldDownload = false;

        SharedPreferences prefs = context.getSharedPreferences(RNAU_SHARED_PREFERENCES, Context.MODE_PRIVATE);
        String currentVersionStr = prefs.getString(RNAU_STORED_VERSION, null);
        if (currentVersionStr == null) {  // when the app first launch is null
            shouldDownload = true;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant