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

Adding an Application or Platform library? #59

Open
hboon opened this issue Dec 15, 2016 · 3 comments
Open

Adding an Application or Platform library? #59

hboon opened this issue Dec 15, 2016 · 3 comments

Comments

@hboon
Copy link
Collaborator

hboon commented Dec 15, 2016

Related to #58.

UI doesn't look like a place to add build_number and version_string. @jjaffeux suggested Application or Platform. This might also be a place for "utility" functions such as retrieving the environment (test, prod, etc).

Since Flow is marked as WIP, we can go ahead with something and refactor later? :)

Ideas?

@hboon
Copy link
Collaborator Author

hboon commented Dec 15, 2016

@jjaffeux
Copy link
Contributor

note : the platform module of react-native https://facebook.github.io/react-native/docs/platform-specific-code.html#platform-module

@andrewhavens
Copy link
Collaborator

I'm not convinced that an Application class would be useful/necessary/intuitive. I kind of feel like build_number is a config setting, or something related to the current build, but not ever something you would reference in your application code.

I think a Platform class makes a lot of sense.

if Platform.iOS?
  puts Platform.sdk_version
end
if Platform.android?
  puts Platform.api_version
end

Though, a Device class may also be a nice alternative:

Device.platform.iOS?
if Device.platform.android?
  puts Device.api_version
  puts Device.scale
  puts Device.screen.width
end

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

3 participants