iTunes app link cannot open page in safari in simulator and also iDevices - iphone

I hope this may be duplicate question. But none of the answers didn't hard help me. I am trying to open a link from my iOS application. When I press the button, It opens the safari app and it always says an alert "Safari cannot open the page because the address is invalid". Here it is a link looks like the same https://itunes.apple.com/gb/app/app_name/id(appId) .
I don't think it is a good place to post the exact the app link. So the above link is dummy link exactly look like mine. Why the error always happening when I try to open the link. I tried in simulator and also in iPod. Same error occurs. If I try the same link with Safari in MAC OS then it works.
Here it is a code I am using to open the safari from my app with a link.
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"https://itunes.apple.com/gb/app/app_name/id(appId)"]];
I am from India. The above link contains gb. Is that link can only open from Great Britain??
UPDATE:
I have good working network. And I tried one more thing. I opened my safari app in simulator and search my app in google and clicking that link shows the same error. Is that a problem with that link in apple side itself??

Kjuly's answer is 90% correct (and +1 to Kjuly!).
If you look at the at the Appirater code,
and in the .m file that has the function that opens up the app store (it's the "rateApp:" method) I see this bit of code:
+ (void)rateApp {
#if TARGET_IPHONE_SIMULATOR
NSLog(#"APPIRATER NOTE: iTunes App Store is not supported on the iOS simulator. Unable to open App Store page.");
#else
So no matter what you try, you are not going to be able to open the App Store app within the simulator. The App Store app does not exist in the simulator, so that's why you get a "not found" error when your web view attempts to redirect to it. This should work fine on the actual device that has the App Store app installed.

Take a try with this URL:
http://itunes.apple.com/app/<appId>
Note: Replace <appId> with your desire App's ID, e.g. id543028543.

That is a possibility as you are specifying the region to which the app belongs or is hosted on the app store under. Try loading the the url without the region 'gb'.

I was having same problem. Links in email not opening, links to App Store not working and App Store not searching or loading apps. I called Appke support. A reset worked! Go to settings to find how the reset under general. It doesn't delete anything either.

Related

How do I Link to my app on iTunes from a website

What URL will properly link up my app Twisted 23 on iTunes?
I tried %20 and + subs for the space character, but returns cannot open the AppStore error. I found an answer that said use deep links, but the link was dead. twisted23 was also tried, but to no avail.
Is there a way to format a URL to open up in the AppStore when clicked from an iOS device?
Now it’s working, first from my iPhone and now my iPad. Earlier my cpanel wouldn’t open in Safari, but worked fine in Chrome.
Prolly just cases of incompatible revisions or viruses abounding aplenty. Yay , even The Brave Browser works on my iPhone!
My final comma is practicing social distancing. :-)

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

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

in app link to app store app

Just trying to make a button that links in ratings tab in app store but have some problems doing so, found lot of links with itms:// and http:// as prefix but non of them work in simulator could anyone help me?
The simulator has no app store; none of them will work.
You want a link like this:
http://www.itunes.com/app/[appname]
That'll work on the device, but not the simulator. There's another variation that lets you specify the company name, too. The link will go to Safari first, which will a moment later open App Store without the user needing to do anything.
Source: Technical Q&A QA1633 Creating easy-to-read links to the App Store for your applications and company
You can try using a itms+apps style link, like this:
itms+apps://www.itunes.com/app/[appname]
This will skip launching Safari first, and just go straight to App Store. While this currently works, I'm not sure it's documented anywhere. I plan on trying this, and I'll update this answer later if I'm approved.
If what you want is a link directly to the Reviews section for your app's App Store page, you want something like this (replace the id parameter with your own):
itms-apps://itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?id=393783219&onlyLatestVersion=true&pageNumber=0&sortOrdering=1&type=Purple+Software
For the main App Store page, use:
http://itunes.apple.com/app/id393783219
And like Steven Fisher said, it won't work on the Simulator.

iPhone: Start or Download App if not exists from Safari

I know its possible to open an app from mobile safari using custom URL Handlers.
Is it possible to open the App Store from Safari on the iPhone and automatically install the app?
Or might it even be possible to open the app if it exists on the users device and to download it if it doesn't?
Best,
heinrich
You can't automatically install the app, but you can go to an App Store URL via UIApplication's openURL: method.
To open another app from within yours, see this question: Launch an app from within another (iPhone). (I don't know how you'd find out if the other app is installed. Maybe just try to open it, and if that fails, open the App Store URL?)

How do I link to another app in the App Store in an iPhone app?

I used this technique, but it appears to not work anymore in 3.0. In the simulator at least, my app opens Safari, and then there is a visible redirect, but then I get a message that there has been too many redirects. Any fix?
Have you tried this on the device? There is no App Store application on the Simulator, so any attempts to redirect to it will fail.
Within my application, the itunes.apple.com links for the App Store work just fine under 3.0 on the actual devices.
I can't test this right now, but have you tried changing the 'http:' protocol in the link to 'itms:' instead?