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

AppVersion.build on iOS needs to be a string #7

Open
eb1 opened this issue Apr 6, 2018 · 1 comment
Open

AppVersion.build on iOS needs to be a string #7

eb1 opened this issue Apr 6, 2018 · 1 comment

Comments

@eb1
Copy link

eb1 commented Apr 6, 2018

I've been playing around with cordova-plugin-app-version for a bit, and noticed some strange behavior on iOS.

iOS uses two string values to indicate the version:

It looks like the file app-version.js is trying to parse the latter value as an integer value:

            _this.build = parseInt(info.build, 10);

Which is causing some weird return values.

Not sure what the proper fix is here, since Android's VersionCode is an integer. Maybe splitting this API into two, an integer for Android and a string for iOS?

@eb1
Copy link
Author

eb1 commented Apr 6, 2018

Just added a line locally to app_version.js, just after the _this.build... line:

        _this.buildString = info.build;

This adds a new API to pass back the CFBundleVersion without converting it, which seems to address values like 1.0.0b3 in that field. I tested it on both Android and iOS without issue.

Should I create a PR to fold this change in?

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