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

Incorrect project.pbxproj key used to detect iOS version #406

Closed
reilem opened this issue Oct 6, 2023 · 2 comments
Closed

Incorrect project.pbxproj key used to detect iOS version #406

reilem opened this issue Oct 6, 2023 · 2 comments

Comments

@reilem
Copy link

reilem commented Oct 6, 2023

Describe the bug/issue

Hi, I am currently looking at using Capgo however I am having trouble understanding this blog post: https://capgo.app/blog/how-version-work-in-capgo/#support

According to this post Capgo will by default use the CURRENT_PROJECT_VERSION key on iOS and versionName key on Android to detect the native version of the application. This perplexes me as it does not align with what I know about mobile app development versioning. In the below table I will show which keys from iOS match with which keys on the android side.

iOS Android Common Usage Example
CFBundleVersion = CURRENT_PROJECT_VERSION versionCode internal build number (integer) 841
CFBundleShortVersionString = MARKETING_VERSION versionName public version (semver) 3.2.5

First off, you technically shouldn't really be using CURRENT_PROJECT_VERSION, you should be looking for CFBundleVersion or CFBundleShortVersionString as these are the values stored in the info.plist and are retrievable at runtime. Source 1, Source 2.

Secondly, here are some definitions from Apple and Google:

  • versionName: "A string used as the version number shown to users. This setting can be specified as a raw string or as a reference to a string resource."
  • versionCode: "A positive integer used as an internal version number."
  • CFBundleShortVersionString: "This key is a user-visible string for the version of the bundle. "
  • CFBundleVersion: "This key is required by the App Store and is used throughout the system to identify the version of the build."

Note how versionName and CFBundleShortVersionString are both publicly visible, and represent the semantic version of the app shown to the users. While versionCode and CFBundleVersion are both internal build identification numbers. Hell, for android versionCode can only be an integer! It seems to me like you guys have mismatched the keys. You should be looking at the CFBundleShortVersionString to check for the iOS version, not the CFBundleVersion?

So I guess my questions are:

  • Is the blog just outdated, and has this already been fixed?
  • If not, what are the available workarounds so that I can still use Capgo?
  • Am I just very stupid and completely misunderstanding something? 😅
@reilem
Copy link
Author

reilem commented Oct 9, 2023

Just to give an update, it seems like the CFBundleShortVersionString is actually being used. I tested it out and capgo will correctly target based on the MARKETING_VERSION / CFBundleShortVersionString and not on the CURRENT_PROJECT_VERSION. So it seems like the blog/documentation surrounding this topic is just incorrect. Would it be possible to update this documentation?

@riderx
Copy link
Contributor

riderx commented Oct 12, 2023

Thanks a lot for showing me this issue in the blog, i corrected it here Cap-go/website@18c074b
hope that more clear now

@riderx riderx closed this as completed Oct 12, 2023
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

2 participants