-
Notifications
You must be signed in to change notification settings - Fork 373
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
App Crash after subscribing to channel #103
Comments
Hi, I don't think SQLite uses the same ports as Pusher - normally pusher-js connects to 80 for unencrypted connections and 443 for encrypted ones. I'm not a specialist in iOS development, it might be an issue with the SQLite plugin or Cordova - they contain native code and are first suspects for me. JS code should not really crash applications. It's hard to tell where the problem is. Maybe a dirty hack is to try calling SQLite and Pusher functions in separate ticks (using |
Hi @pl , |
Related: https://issues.apache.org/jira/browse/CB-9102 I just fixed this bug in my app: it happens if, within the same event loop that you handle a pusher callback (or any callback that ultimately originates from a native WebSocket event), you make a call through cordova back into native code. It is "fixed" by setting a JS timeout before handling the event. @pl integrating Pusher with Cordova (or a Cordova-like environment) is very common, and this bug is tricky and misleading enough that it might be beneficial to just build the setTimeout into the pusher JS lib to prevent these issues from happening in the first place. I don't think this would affect user apps in any way, whether it be timing or performance. And FWIW it would probably have to be a timer, and not anything tricky like using MutationObservers to do a next tick. |
@machty how did you integrate pusher for push notifications in your cordova app ? |
@machty For now I think this issue will be enough for anyone that runs into a similar problem, but I think you raised a good point and we will look into implementing that in the future. |
Hi @pl,
I have a chat mobile application(using cordova) that use pusher to serve messages,
the application is working excellent on android devices, and IOS 7-, but it crash on IOS8.
After debugging i discovered that when i subscribe to a channel and use (Sqlite plugin)[www.github.com/brodysoft/Cordova-SQLitePlugin] in the same time, the application crash.
Therefore, i think that they use the same ports...
Did you hear about this issue before!!. and please let me know about the ports used by pusher-js.
Thank you.
The text was updated successfully, but these errors were encountered: