iOS Question About version and build

Ju Yang

Active Member
Licensed User
Longtime User
It seems that the #version project attribute will set both CFBundleShortVersionString and CFBundleVersion, i.e. if we add below line in the project header,
B4X:
#version 1.0.0
usually we will see "1.0.0(Build 1.0.0)" when the ipa files will be parsed by some 3rd party application.

I would think it is because b4i will set both CFBundleShortVersionString and CFBundleVersion to "1.0.0", but actually sometimes we want to use some other numbers such as 1234 for the build number(say CFBundleVersion). For example, we want it to be displayed as "1.0.0(Build 1234)". Is there any way to set it in b4i and then the CFBundleVersion could be customized (instead of being the same as CFBundleShortVersionString)?
 

JanPRO

Well-Known Member
Licensed User
Longtime User
B4X:
Sub GetBundleVersion As String
    Dim NaObj As NativeObject
    Return NaObj.Initialize("NSBundle").RunMethod("mainBundle",Null).RunMethod("infoDictionary",Null).RunMethod("objectForKey:",Array("CFBundleVersion")).AsString
End Sub

:)
 
Upvote 0
Top