“Safari cannot open the page because the address i

2019-07-04 21:44发布

问题:

I have an iPhone 4s with iOS7 that doesn't have the Google Maps app installed on it. Whenever I try to navigate to a location link on it, it flashes an error at me that says:

Cannot Open Page
Safari cannot open the page because the address is invalid

But then the error goes away (without having to hit OK) and the map shows up, and all subsequent Google Maps links load without this error. When I clear my cache, the error shows up again, but only for the first time, and again disappears on its own.

This is the link in question that I am using, but I have tested it with multiple links and the problem seems to be persistent:

https://www.google.com/maps/place/Kraftwork/@39.971494,-75.127336,17z/data=!3m1!4b1!4m2!3m1!1s0x0:0x6db3f86eca2f8b45?hl=en

Any idea what's causing this problem?

To be specific, this problem exists as a result of straight html and just attempting to click a maps link.

回答1:

I treid to paste to link in the Safari directly and do it programmatically in both iOS 7 and iOS 8 with iPhone 4s, both work for me. Maybe you can try it with iOS 8 simulator with your XCode too.

[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"https://www.google.com/maps/place/Kraftwork/@39.971494,-75.127336,17z/data=!3m1!4b1!4m2!3m1!1s0x0:0x6db3f86eca2f8b45?hl=en"]];