Hacker News new | comments | show | ask | jobs | submit login

Let me get this straight: You think it's more reasonable for Apple to have to build in special support so requests for webpages on plus.google.com go to the G+ app instead of Safari than for Google to just make their site work on mobile platforms like everybody else on the planet?

You are, as the kids say, straight trippin'.

Well, not exactly. But that is the way that Android works, and it's pretty fantastic. When an app takes an action, it launches an Intent that notifies the OS of the details of that action. The appropriate application is launched (or the user is presented with options, in the case where there are two or more applications that know how to handle that Intent. In this case, it's both the Browser and Google+).

I was mostly asking if iOS had similar functionality, but it appears not.

Yes, but to then go on and say Google shouldn't worry about whether their site is even legible because, hey, it's the user's fault for choosing a phone that isn't based on intents? That's just silly.

But no, iPhone doesn't have that functionality.

I didn't mean to say that they shouldn't worry about it. I more meant that it's probably lower priority, and for an understandable reason. I'm sure they want to fix the web page and I'm sure they will - but the iPhone Safari market share is probably very, very small when looking at the Google+ user stats.

Also, I thought it relevant to mention here that you can indeed read the post very clearly on the iPhone - but a seeming lack of this feature (Intents) in iOS makes this awkward.

I've never developed for iOS, but on my iPhone when I go to okcupid.com it somehow 'redirects' to the okcupid app on my phone. So it seems there is some capability for this built in that website developers can take advantage of.

There is: Apps can register to handle certain URL schemes, so all you need to do is put in a redirect to (for example) "okcupid://profile/109" and, since Safari doesn't handle URLs with the okcupid scheme, the OKCupid app will be asked to open the URL instead. But again, this would require the plus.google.com team to actually implement it.

iOS apps can register foobar:// hooks. If a site redirects to a URI with a custom protocol, it'll wake up the app that's tied to it.

(I'm not sure how they're detecting whether that hook is registered or not, though.)

It looks like they basically ask whether you want to use the site or the app the first time you visit on a device, and if you choose the app, it sends you to the App Store and sets a localstorage setting that triggers a redirect on subsequent visits. (Edit: OK, it's a little bit more sophisticated than that. But I think that's not too far off.)

Mobile Safari does support apps registering custom URL handlers, so google could rewrite the links as gplus:// and they could open in the G+ app. Unfortunately I don't think this behaves nicely if you don't have the content handling app installed since it just errors.

That's correct. If you don't have the app in question installed, you get a nasty "Page could not be found" error. There are hacky and unstable JS tricks you can pull with setTimeout to send the user to the app store if they don't have the app installed, but I haven't heard of any reliable way to deal with this (pretty glaring) failure case.

Even just the ability to suppress the error message would be more or less fine.

How about loading the gplus:// link in a hidden iframe. Then continue to load the page in the browser. If they have the app installed, it will redirect, otherwise the page will just load in the browser.

I'm fairly sure when I tried something like that it popped up a "Page not found" dialog. I may have been doing it wrong though.

But then you have an extraneous page loaded.

So just load up the page (on iOS user-agents) with a big red button up top which allows the user to self-redirect, or default a preference on the G+ profile (if they're logged in).

Reasonable or not, that is the expectation Apple has encouraged iPhone users to hold - every website should have its own app in a way reminiscent of AOL keywords.

Expectation for who? It has never occurred to me to install an app to view a single website. Maybe this is something you do, and therefore think that other people also do.

But you're mistaken. I browse the web using a web browser. Even on my iPhone.

Since I don't own an iPhone, your assumption is incorrect. My spouse and many other non-technical people I know do own iPhones. And it is very common for them to use apps rather than their browser to access web content.

I call shenanigans. Practically every "content" site out there has its own app, and loudly proclaims its existence whenever you visit its site with a compatible device. It's simply not possible that "it never occurred" to you. You can obviously choose not to install a Google+ app if you like. But I don't believe for a minute that you are surprised at the need for it.

That's how Android Intents work, Apps can register to handle domains.

In my opinion, it's a far more elegant solution than encouraging developers to register pseudo-protocols to use in URLs that also result in very awkward interactions if the app's mobile site tries to redirect to the app and it is not installed. (Then again, this gives users a "choice" (!) of whether to open links or Intents in the mobile app or native app.)

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact