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

global.ios missing (consistancy) #941

Closed
NathanaelA opened this issue Oct 14, 2015 · 5 comments · Fixed by #949
Closed

global.ios missing (consistancy) #941

NathanaelA opened this issue Oct 14, 2015 · 5 comments · Fixed by #949
Assignees
Milestone

Comments

@NathanaelA
Copy link
Contributor

global.android is defined when the app is running on a Android. However global.ios is never defined. Either add global.ios or remove global.android to keep platform consistancy as when anyone sees a global.android they will assume the other global.PLATFORMS exists also.

@enchev
Copy link
Contributor

enchev commented Oct 15, 2015

Hey @NathanaelA,

I believe that android comes from the native Android namespaces exposed while in the other hand there are no namespaces in iOS platform and that is why there is no global ios object defined.

If you want to check in your code what is the current platform you can use our platform module.

Thanks

@NathanaelA

This comment was marked as abuse.

@atanasovg
Copy link
Contributor

@NathanaelA: @enchev is correct - the Android Runtime injects these top-level packages directly into the global context. Consider for example the android.widget.Button expression - android here is actually global.android. In iOS there are no such top-level packages, the entire API is available at the global context and the equivalent of the previous expression is UIButton. So, global.android is not something that we do explicitly to mark the current execution context. It is just the way the native Android APIs work. With that said, adding an artificial global.ios property, be it at Runtime or at JS level, simply does not make sense to me. Still, you can always have your app.ios.js where you register it for your application.

@NathanaelA

This comment was marked as abuse.

@enchev enchev self-assigned this Oct 16, 2015
@enchev enchev added the bug label Oct 16, 2015
@enchev enchev added this to the 1.5 (Under Review) milestone Oct 16, 2015
@enchev enchev added the done label Oct 16, 2015
@lock
Copy link

lock bot commented Aug 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants