{"action":"created","issue":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14260","labels_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14260/labels{/name}","comments_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14260/comments","events_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14260/events","html_url":"https://github.com/cocos2d/cocos2d-x/pull/14260","id":113886708,"number":14260,"title":"Added Application::getVersion() to get the app version.","user":{"login":"pyrosphere","id":779064,"avatar_url":"https://avatars.githubusercontent.com/u/779064?v=3","gravatar_id":"","url":"https://api.github.com/users/pyrosphere","html_url":"https://github.com/pyrosphere","followers_url":"https://api.github.com/users/pyrosphere/followers","following_url":"https://api.github.com/users/pyrosphere/following{/other_user}","gists_url":"https://api.github.com/users/pyrosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/pyrosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyrosphere/subscriptions","organizations_url":"https://api.github.com/users/pyrosphere/orgs","repos_url":"https://api.github.com/users/pyrosphere/repos","events_url":"https://api.github.com/users/pyrosphere/events{/privacy}","received_events_url":"https://api.github.com/users/pyrosphere/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-28T18:09:52Z","updated_at":"2015-10-28T21:54:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/pulls/14260","html_url":"https://github.com/cocos2d/cocos2d-x/pull/14260","diff_url":"https://github.com/cocos2d/cocos2d-x/pull/14260.diff","patch_url":"https://github.com/cocos2d/cocos2d-x/pull/14260.patch"},"body":"Added a method to the Application class to get the version of the app on iOS/Mac/Android/Win8, on the remaining platforms that don't have app versions it should return an empty string.\r\n\r\nThe feature has been requested in this discussion thread: http://discuss.cocos2d-x.org/t/check-app-version/6294/5"},"comment":{"url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/comments/152006402","html_url":"https://github.com/cocos2d/cocos2d-x/pull/14260#issuecomment-152006402","issue_url":"https://api.github.com/repos/cocos2d/cocos2d-x/issues/14260","id":152006402,"user":{"login":"pyrosphere","id":779064,"avatar_url":"https://avatars.githubusercontent.com/u/779064?v=3","gravatar_id":"","url":"https://api.github.com/users/pyrosphere","html_url":"https://github.com/pyrosphere","followers_url":"https://api.github.com/users/pyrosphere/followers","following_url":"https://api.github.com/users/pyrosphere/following{/other_user}","gists_url":"https://api.github.com/users/pyrosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/pyrosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pyrosphere/subscriptions","organizations_url":"https://api.github.com/users/pyrosphere/orgs","repos_url":"https://api.github.com/users/pyrosphere/repos","events_url":"https://api.github.com/users/pyrosphere/events{/privacy}","received_events_url":"https://api.github.com/users/pyrosphere/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T21:54:56Z","updated_at":"2015-10-28T21:54:56Z","body":"Personally I would prefer an empty string as it would let you check for `.empty()` and not display that information rather than an incorrect number. If you'd want to have \"1.0\" you could always do something like:\r\n```\r\nstd::string version = cocos2d::Application::getVersion();\r\nif (version.empty()) { version = \"1.0\"; }\r\n```"}}