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

Using with Google Maps iOS SDK #219

Closed
zachlucas opened this issue Oct 12, 2016 · 2 comments
Closed

Using with Google Maps iOS SDK #219

zachlucas opened this issue Oct 12, 2016 · 2 comments

Comments

@zachlucas
Copy link

I'm trying to stub my Google Places calls using a local json file. Using Charles proxy, I find that the Google Maps SDK uses the url https://www.googleapis.com. So, I try to stub like:

stub(isHost("https://www.googleapis.com")) { request in
   OHHTTPStubsResponse(fileAtPath: "google_maps.json", statusCode: 200, headers: ["Content-Type":"application/json"])
}

But it's not intercepting the google maps SDK calls. Any ideas? Could this be the Google Maps SDK using something other than Cocoa's URL Loading System?

@AliSoftware
Copy link
Owner

https://www.googleapis.com" is not a host. That a full URL. The host of this URL (as returned by NSURL(string: "https://www.googleapis.com")!.host for example) is just www.googleapis.com.

@zachlucas
Copy link
Author

Thank you, that was my issue.

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