-
Notifications
You must be signed in to change notification settings - Fork 948
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
Reachability returns incorrect reachability status #375
Comments
Are you doing it on the simulator? Seems to be an issue in the simulator, but works correctly on the actual device. |
Yes I tried in simulator. Ok I will try on device and update you if I face the same issue. |
Do you still have the same issue on the simulator? How did you solve it to be able to test on the Simulator? Thanks |
I do not believe you can. Simulator uses Mac’s connection so the only way
is either actual device or turn off connectivity for Mac while testing.
…On Wed, Aug 24, 2022 at 4:39 PM James Laurenstin ***@***.***> wrote:
Do you still have the same issue on the simulator? How did you solve it to
be able to test on the Simulator? Thanks
—
Reply to this email directly, view it on GitHub
<#375 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2YPBIRHAFYQOH5YDOZ5G3V22CBDANCNFSM4WLBIKFA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@kostiag Thanks for the quick reply. I don't believe we can either in simulator as it uses the mac's connection. But I wanted to make sure. I could do a quick workaround (in simulator mode) by making a request to let's say "www.google.com" or "www.apple.com"...it doesn't matter and see if I get a 200 code back? This will tell me if I'm on connected or not (only on Simulator) since the reachability doesn't seem to be working properly in simulator. |
Sure you could but why ? Too much work for testing purposes rather than
just using device or unplugging your machine for the test. But whatever
works for you I guess. Have not looked into this since original question.
…On Wed, Aug 24, 2022 at 4:48 PM James Laurenstin ***@***.***> wrote:
@kostiag <https://github.com/kostiag> Thanks for the quick reply. I don't
believe we can either in simulator as it uses the mac's connection. But I
wanted to make sure. I could do a quick workaround (in simulator mode) by
making a request to let's say "www.google.com" or "www.apple.com" and see
if I get a 200 code back? This will tell me if I'm on connected or not
(only on Simulator) since the reachability doesn't seem to be working
properly in simulator.
—
Reply to this email directly, view it on GitHub
<#375 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA2YPBK4XX2NV72AP34P5H3V22DBBANCNFSM4WLBIKFA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@kostiag When I turn on/off wifi on my machine while running from the simulator. Currently, the Reachability framework detects the connection change but returns the wrong status...makes testing on the simulator difficult...especially if you don't have a device handy to run your tests. On a device, the same code works as expected and well. It's only on the simulator the status is a big wonky |
@kostiag I'll give my idea a try and see if it's solves my issue. Thanks for the inputs. :) |
+1, wrong status is returned on change, when testing on simulator |
Xcode : 12.1
iOS : 14.1
Reachability : 5.1.0
I implemented below code in my viewcontrollers.
In view did load
in another method
This code works properly on first view controller. For second view controller,
self.reachability.allowsCellularConnection
always returnstrue
.The text was updated successfully, but these errors were encountered: