-
Notifications
You must be signed in to change notification settings - Fork 163
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
PusherConnection delegate crash #109
Comments
Do you have a stack trace or error message? |
Does this help?
|
Hmmm, are you setting a breakpoint anywhere? Also, where is that code that you pasted being run? In a ViewController? Do you have a sample project / app that you could provide that exhibits the problem? Thanks! |
No, not using any breakpoints. The code runs in a |
Hmm, can't reproduce in an empty project with the code used in the full project. Let me investigate further. |
Strange - I can't seem to replicate this in an empty project. Let me close this for now and investigate further. Will reopen when I find something. |
Seeing this one also, curious if you figured out the cause @BasThomas? |
Haven't had time to look into it yet. Will update when I find something. |
@ay8s do you have a sample app that reproduces this? Are you getting the same error / stack trace? Or if easier, could you share the code where you're doing Pusher-related things? This sounds like a nasty crash so I'm keen to dig into it and fix it! |
It's crashing in an empty project for me now as well. I'll create a repo. |
Thanks for the project - just been having a play and I think it's that the I'm not sure what the best solution is here. Perhaps Or maybe it's a question of making the expected usage clearer in the docs. In your example project I get the crash but even if you were to comment out all of the reachability code then I don't think the Pusher interactions would work as expected seeing as the objects would be being cleaned up as soon as the view loads. WDYT? |
Hmm, I see what the problem is. IIRC this was a problem with Apple's I am not sure what the difference between |
So @ay8s, if this is vague for you - if you declare: var pusher: Pusher! in your |
As I understand it, I'm not sure if there's a way to stop the deallocation of the And thanks for the code snippet explaining what I meant! |
Would still be good to see what your setup is @ay8s, if you're cool with that |
Right. Tricky issue. I think it'd be good to explicitly tell developers in the docs and code snippets, and explain why it is necessary. |
I think I'll likely do a couple of things:
And like I said, I'll wait to see if Andy has anything to add before closing this. Thanks for the input @BasThomas! |
Yep, that seems like a great idea! And you're welcome on the input 🙂 |
I've gotten round to doing what I described above, at least in terms of code. Still going to make README additions |
Hey I'm facing this strange issue. All works fine when app is in foreground. As soon as I put app in background and Lock the phone. I see in Xcode logs I'm getting this error message with no Push notification for messages. |
Hi, when following the standard getting started, calling
pusher.connect()
crashes on line 42 inPusherConnection.swift
. Specifically, the line shown here crashes.I can track it back as far as line 171 in
Reachability.swift
:My code:
My
PusherSwift.swift
:Any idea?
The text was updated successfully, but these errors were encountered: