Closed Bug 859456 Opened 11 years ago Closed 8 years ago

Pinterest - Not offered choice to handle associated application with intent; unable to launch Google Play to get their native application

Categories

(Web Compatibility :: Site Reports, defect)

ARM
Android
defect
Not set
normal

Tracking

(firefox20 affected, firefox21 affected, firefox22 affected, firefox23 affected)

RESOLVED FIXED
Tracking Status
firefox20 --- affected
firefox21 --- affected
firefox22 --- affected
firefox23 --- affected

People

(Reporter: aaronmt, Unassigned)

References

()

Details

(Whiteboard: [sitewait] [country-all])

Attachments

(1 file)

http://www.pinterest.com; tap the 'Download' button in their Android native app banner

D/Instrumentation(18927): checkStartActivityResult  :Intent { act=android.intent.action.VIEW dat=pinit12://m.pinterest.com/ flg=0x4000000 }
D/Instrumentation(18927): checkStartActivityResult  inent is instance of inent:
I/ApplicationPolicy( 2310): isIntentDisabled start :Intent { act=android.intent.action.VIEW dat=pinit12://m.pinterest.com/ flg=0x4000000 }
I/ApplicationPolicy( 2310): isIntentDisabled resolve info :null
I/ApplicationPolicy( 2310): isIntentDisabled return :false

"Launch Application" dialog yields nothing on tap of OK. Chrome will launch a 'Complete action using' dialog where one can always select Google Play or another handler.
This is their deep-linking library: http://passets-ec.pinterest.com/js/deep_linking_eeddde72.js which handles their code.
Attached file Pinterest deeplink.js
Adding it here in-case the URL changes
Weird. They load a hidden iframe with the current url and the protocol replaced with pinit12. in onload, they redirect the frame to the app store. i.e.: 

redirectFrame.src = pinit12://m.pinterest.com/;
redirectFrame.onload = function noapp() { window.location=selfRef.android_app_dl_url; };

where android_app_dl_url points to the play store. I guess the pinit12 url should open the native app if its installed and otherwise they want to redirect to the play store, but we throw up at the un-known url (like I'd expect us to) and never call onload. Seems like we're doing things right AFAIK. They're just utilizing a webkit/chrome bug where it calls onload even if pages don't load.
I sent them an help request email pointing to this bug.
Component: General → Mobile
Product: Firefox for Android → Tech Evangelism
Summary: Not offered choice to handle associated application with intent; unable to launch Google Play → Pinterest - Not offered choice to handle associated application with intent; unable to launch Google Play to get their native application
Marking sitewait since Aaron already contacted them.
Whiteboard: [sitewait]
Mike - Can you help with this one?
I also just tweeted at a pinterest employee (found from their github org) https://twitter.com/MozWebCompat/status/388676340796256260.

Based on this comment,

//Try to deep link to the mobile app on ios.  Android, send them to
//the app page url.

They know that deep-linking to the app won't work. I wonder if it would be enough to change redirectFrame.src = androidAppURL; to something like redirectFrame.src = "about:blank" so it would work everywhere.
(In reply to Lawrence Mandel [:lmandel] from comment #6)
> Mike - Can you help with this one?

Given that there are multiple Mikes on this bug I should have been clearer. Mike Beltzner is the Pinterest product manager and a Mozillian. I'm hoping that he can help push this forward.
Flags: needinfo?(mbeltzner)
We need a good solution for this sort of issue on our end too. I've been actively working on web intents which should help (but are pretty mozilla specific). Open to ideas...
Whiteboard: [sitewait] → [sitewait] [country-all]
> Weird. They load a hidden iframe with the current url and the protocol
> replaced with pinit12. in onload, they redirect the frame to the app store.
> i.e.: 

This is a pretty common pattern on iOS, which we likely copied to Android. I'll file an internal task to see this resolved. AIUI, on Android, we should just be able to call the URI pattern and if the app is installed it'll ask us if we want to use Pinterest or a web browser to handle. Is that what you'd expect as well?
Flags: needinfo?(mbeltzner)
Actually, thinking more on that, if we use the mechanism that I propose, then we'd have to:

 - point the user to something like pinterest.com/getapp
 - if the app is installed, deep linking will handle
 - otherwise it'll load in a browser

But we don't want it to load in a browser (even if there's a redirect) because we actually want the other action to just lead directly to Google Play store.

Any hints as to what you'd recommend, instead?
Aaron, do we have any good answer to Mike's question?
Flags: needinfo?(aaron.train)
Probably a question for Wes.
Flags: needinfo?(aaron.train)
I think I need to ask bz or someone from the DOM world what's expected here. i.e. given something like:

myIframe.src = "pinit12://m.pinterest.com/";
myIframe.onload = function() { window.location = "market://pinterest.com"; };

should the second onload handler ever fire? Even if it SHOULD, I worry that we'd be leaking private data about installed apps to the web.
Flags: needinfo?(bzbarsky)
> should the second onload handler ever fire?

You mean for the "market://pinterest.com" load?

I'd think not, unless we support the "market" URI scheme and actually load something in the frame.  At least that's what the spec says, last I checked.  See http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#navigating-across-documents step 10.
Flags: needinfo?(bzbarsky)
Is this still an Evangelism issue or should it be converted or linked to a bug for the platform?
It seems we have a use case that we only sort-of handle through a hack. We should probably step back and ask ourselves if we want to handle this use case (triggering native apps in a way that lets you know the native app is installed and ran) - and if yes, how.

If we don't have a coding fix for the site, it's not really a tech evang issue IMO.
This is fixed.
We implemented intent:
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
Component: Mobile → Site Reports
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: