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

Error initializing Parse in iOS client code. #641

Closed
astanton opened this issue Feb 25, 2016 · 2 comments
Closed

Error initializing Parse in iOS client code. #641

astanton opened this issue Feb 25, 2016 · 2 comments

Comments

@astanton
Copy link

I'm in the middle of the migration process and at the point I'm trying to run my server locally. I have the server up and running, and can hit it using CURL no problem, even hitting my db on mongolab.

However when I try to initialize Parse in my iOS app, it fails to connect. My configuration looks like the following (with the real values in there):

Parse.initializeWithConfiguration(
  ParseClientConfiguration(block: { (configuration:ParseMutableClientConfiguration) -> Void in
    configuration.applicationId = "appId"
    configuration.clientKey = "clientKey"
     configuration.server = "http://localhost:1337/parse"
   })
)

However, whenever I have this line in my appdelegate normal initialization spot, I have the following erorrs in my console because it is failing to connect:

2016-02-24 22:45:24.061 TestApp[12580:2788400] [Error]: The operation couldn’t be completed. (NSURLErrorDomain error -1004.) (Code: 100, Version: 1.12.0)
2016-02-24 22:45:24.061 TestApp[12580:2788400] [Error]

It then continues to retry but obviously just continues to fail. Again, I know it's up and running because I can query the database on mongolab running the CURL command and hitting the endpoint with the correct headers passed in.

I have been trying to figure this out all evening and haven't had any luck so I thought I would ask here.

Any ideas?

@drew-gross
Copy link
Contributor

Your iOS device can't connect to your localhost because localhost means the same device (if you tried it on the simulator it would probably work)

Try exposing your localhost server through something like ngrok or pagekite.

@astanton
Copy link
Author

@drew-gross thank you very much that worked. I saw that step at the very end of the local-server installation, and I didn't know what ngrok was so I figured it was an npm install, and I installed it through npm but figured it was some library that was needed under the hood. Didn't realize it was tunneling software.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants