“Safari cannot open the page because the address is invalid” for Google Maps link

青春壹個敷衍的年華 提交于 2019-12-10 20:27:23

问题


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"]];


来源:https://stackoverflow.com/questions/27049228/safari-cannot-open-the-page-because-the-address-is-invalid-for-google-maps-lin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!