-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
WebSocket hack loads iff iOS Cordova #138
Conversation
It makes sense. BTW, is this 100% reliable?: window.cordova.platformId === 'ios' |
|
If the WS wrapper is loaded once Cordova is ready that would lead to issues with JS scripts that are loaded synchronously and use the Is there some way of detecting the platform before Cordova "deviceready" event? |
In that case, this will work as is. You just need to ensure that Sent from my iPhone
|
I don't add |
@@ -17,6 +17,9 @@ | |||
|
|||
|
|||
(function () { | |||
// run on iOS Cordova only | |||
if (!(window.cordova && window.cordova.platformId === 'ios')) return; | |||
|
|||
// Store a reference of the native WebSocket class. | |||
var NativeWebSocket = window.WebSocket; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May you please keep the project indentation and use TAB instead of spaces? Running gulp
should throw one or more lint/style errors.
This I assumed |
I want to support this pull request. As Meteor is using Websockets heavily, I did not want to let the hack to be run outside the iOS context, so I patched this file manually. |
Will be available in version 3.0.1. Thanks. |
There's no easy way to for us to have conditional
<script>
tags for each individual platform in ourindex.html
. The easiest way seems to be just to have conditional execution right in theios-websocket-hack.js
file itself. This way, all platforms can load the same script but only iOS Cordova will have this WS hack enabled.