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

Add methods to UI::Application to return app build number and version number #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions flow/ui/android/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ def proxy
frame_layout
end
end

def version_number
UI.context.applicationContext.packageManager.getPackageInfo(UI.context.applicationContext.packageName, 0).versionName
end

def build_number
UI.context.applicationContext.packageManager.getPackageInfo(UI.context.applicationContext.packageName, 0).versionCode
end
end
8 changes: 8 additions & 0 deletions flow/ui/cocoa/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,13 @@ def start
def proxy
@proxy ||= UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)
end

def version_number
NSBundle.mainBundle.objectForInfoDictionaryKey('CFBundleShortVersionString')
end

def build_number
NSBundle.mainBundle.objectForInfoDictionaryKey('CFBundleVersion')
end
end
end