Closed Bug 965282 Opened 6 years ago Closed 6 years ago

Bad experience with no Firefox browser installed

Categories

(Firefox for Android :: Web Apps (PWAs), defect, P1)

29 Branch
ARM
Android
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronmt, Unassigned)

Details

(Whiteboard: [WebRuntime])

Attachments

(1 file)

Currently upon launching an installed application, the application will launch and the ActivityManager also launches Google Play for a search for Firefox 

I/ActivityManager(  614): START u0 {act=android.intent.action.VIEW dat=market://search?q=pname:org.mozilla.firefox cmp=com.android.vending/com.google.android.finsky.activities.MainActivity} from pid 11304

Upon hitting back, the user is taken back to the application which simply draws an orange background and does nothing. 

Suggestion, display an Android alert dialog that indicates that Firefox is required and then on 'Ok' return the user back to the default market.

On install of Firefox (Nightly in my case), re-launching the installed application continued to not work (maybe fixed with bug 964877)

I/Gecko   (13611): *************************
I/Gecko   (13611): A coding exception was thrown in a Promise resolution callback.
I/Gecko   (13611): 
I/Gecko   (13611): Full message: TypeError: app.receipts is undefined
I/Gecko   (13611): See https://developer.mozilla.org/Mozilla/JavaScript_code_modules/Promise.jsm/Promise
I/Gecko   (13611): Full stack: doInstall@resource://gre/modules/Webapps.jsm:1847
I/Gecko   (13611): this.WebappManager.autoInstall/<@resource://gre/modules/WebappManager.jsm:195
I/Gecko   (13611): Handler.prototype.process@resource://gre/modules/Promise.jsm:767
I/Gecko   (13611): this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm:531
I/Gecko   (13611): 
I/Gecko   (13611): *************************

E/GeckoConsole(13611): [JavaScript Error: "A promise chain failed to handle a rejection.
E/GeckoConsole(13611): 
E/GeckoConsole(13611): Date: Wed Jan 29 2014 11:03:16 GMT-0500 (EST)
E/GeckoConsole(13611): Full Message: TypeError: app.receipts is undefined
E/GeckoConsole(13611): Full Stack: doInstall@resource://gre/modules/Webapps.jsm:1847
E/GeckoConsole(13611): this.WebappManager.autoInstall/<@resource://gre/modules/WebappManager.jsm:195
E/GeckoConsole(13611): Handler.prototype.process@resource://gre/modules/Promise.jsm:767
E/GeckoConsole(13611): this.PromiseWalker.walkerLoop@resource://gre/modules/Promise.jsm:531
E/GeckoConsole(13611): " {file: "resource://gre/modules/Webapps.jsm" line: 1847 column: 0 source: "1847"}]
(In reply to Aaron Train [:aaronmt] from comment #0)
> Currently upon launching an installed application, the application will
> launch and the ActivityManager also launches Google Play for a search for
> Firefox 
> 
> I/ActivityManager(  614): START u0 {act=android.intent.action.VIEW
> dat=market://search?q=pname:org.mozilla.firefox
> cmp=com.android.vending/com.google.android.finsky.activities.MainActivity}
> from pid 11304
> 
> Upon hitting back, the user is taken back to the application which simply
> draws an orange background and does nothing. 
> 
> Suggestion, display an Android alert dialog that indicates that Firefox is
> required and then on 'Ok' return the user back to the default market.

mhaigh has been working on an enhancement that does exactly this: it tells the user they need Firefox, directs them to the Google Play store to install it, and then observes its installation and launches the app.

But the enhancement is to the APK Factory library <https://github.com/mozilla/apk-factory-library>, not Fennec itself, so I'm unsure where best to track it.  cc:ing ozten for his input.

ozten: Where should we track work to do on the library?


> On install of Firefox (Nightly in my case), re-launching the installed
> application continued to not work (maybe fixed with bug 964877)

Yes, this is bug 964877, which prevents all apps installed from outside Fennec from launching.
I don't have a preference.

mhaigh or jhugman, where do you want library bugs?

Why don't we use the component, until someone creates or voices a different one.
I'm happy with bugs being filed in Firefox for Andriod/Webapps.
Priority: -- → P1
Summary: (Synth APK) - Bad experience with no Firefox browser installed → Bad experience with no Firefox browser installed
Whiteboard: [WebRuntime]
mhaigh - are you still on this? Should I take it?

Based upon conversations in SF, we should just slap our own UX up, and refine it later.
Flags: needinfo?(mhaigh)
Comment on attachment 8394937 [details] [diff] [review]
bug-965282-1.patch


>diff --git a/res/values/strings.xml b/res/values/strings.xml

>+    <string name="install_fennec_dialog_message">The app requires a compatible Runtime to run, in this case Firefox For Android.</string>
>+    <string name="install_fennec_dialog_title">Install Firefox for Android</string>
>+    <string name="install_fennec_dialog_button_cancel">Not now, thanks</string>
>+    <string name="install_fennec_dialog_button_ok">Install from the Play store</string>

Future: How do we want to do l10n on these strings? Maybe we already do.

>diff --git a/src/org/mozilla/android/synthapk/C.java b/src/org/mozilla/android/synthapk/C.java

>-    public static final String FENNEC_PACKAGE_NAME = "org.mozilla.firefox";
>+    public static final String FENNEC_PACKAGE_NAME = "org.mozilla.firefox_beta";

What's the plan for 6 weeks from now? Will we change back to org.mozilla.firefox ?

>diff --git a/src/org/mozilla/android/synthapk/InstallRuntimeActivity.java b/src/org/mozilla/android/synthapk/InstallRuntimeActivity.java

>         if (isCallable(marketIntent) > 0) {

Does this allow us to skip the "market:" code if the Play Store is not installed? We do have some phones where that will be the case.

r+, but I'm interested in any answers you might have.
Attachment #8394937 - Flags: review?(mark.finkle) → review+
Flags: needinfo?(mhaigh)
> How do we want to do l10n on these strings? Maybe we already do.
Unknown.

> What's the plan for 6 weeks from now? Will we change back to org.mozilla.firefox ?
Yes, but it hasn't been well articulated yet.

> Does this allow us to skip the "market:" code if the Play Store is not installed? We do have some phones where that will be the case.
Very good link to start with: http://www.onepf.org/appstores/

From there I can't find any kind of comprehensive view of how to invoke the marketplaces.

Yandex respects the same marketplace links as the Play store. https://stackoverflow.com/questions/21280212/uri-formats-for-linking-to-a-specific-app-and-publisher-page-on-yandex-store
Amazon has uses http links, which are going to be caught by any browser. I can't find any evidence to suggest it respects the market:// links.

From looking at decompiles of WeChat, Tencent (who make WeChat, and are the biggest chinese appstore) also uses the same link. https://github.com/danghvu/WeChatRE/blob/4b249bce4062e1f338f3e4bbee273b2a88814bf3/src/unk/com/tencent/mm/sdk/platformtools/d.java#L14 However, it falls back to use an http based scheme.

Also looking at F-Droid, it respects market:// intents. https://gitorious.org/f-droid/fdroidclient/source/ce3f210919b483d7bfe3e5886d91bc6ae71957f6:AndroidManifest.xml#L198

That's three, of varying sizes. However, it doesn't take into account marketplaces we're in, or have a sensible fallback (e.g. direct download).

If you have any information on other marketplaces, that'd be awesome. I'd quite like to be able to detect which marketplaces you have available, and give the user the choice. I expect the easiest way of doing this would be to start a library project on github.
Comment on attachment 8394937 [details] [diff] [review]
bug-965282-1.patch

Review of attachment 8394937 [details] [diff] [review]:
-----------------------------------------------------------------

Mostly Strings comments. If someone from UX wants these, ignore me :)

::: res/values/strings.xml
@@ +1,4 @@
>  <?xml version="1.0" encoding="utf-8"?>
>  <resources>
>      <string name="title_activity_installer">Installing…</string>
> +    <string name="install_fennec_dialog_message">The app requires a compatible Runtime to run, in this case Firefox For Android.</string>

And this seems like too much jargon/info. i.e. "This app requires Firefox for Android to run.".

@@ +1,5 @@
>  <?xml version="1.0" encoding="utf-8"?>
>  <resources>
>      <string name="title_activity_installer">Installing…</string>
> +    <string name="install_fennec_dialog_message">The app requires a compatible Runtime to run, in this case Firefox For Android.</string>
> +    <string name="install_fennec_dialog_title">Install Firefox for Android</string>

At that point this one feels repetitive though. Maybe it can just be "Install".

@@ +3,5 @@
>      <string name="title_activity_installer">Installing…</string>
> +    <string name="install_fennec_dialog_message">The app requires a compatible Runtime to run, in this case Firefox For Android.</string>
> +    <string name="install_fennec_dialog_title">Install Firefox for Android</string>
> +    <string name="install_fennec_dialog_button_cancel">Not now, thanks</string>
> +    <string name="install_fennec_dialog_button_ok">Install from the Play store</string>

These button strings seem kinda long. I think we usually just use short one word things. "Install" "Cancel"?

::: src/org/mozilla/android/synthapk/InstallRuntimeActivity.java
@@ +75,5 @@
>          super.onActivityResult(requestCode, resultCode, data);
>          boolean nextStep = false;
> +        Log.i(C.TAG, "Returning from the marketplace. Result code = " + resultCode);
> +        if (requestCode == R.id.install_runtime_from_market) {
> +            nextStep = LauncherActivity.isLaunchable(this) ? installWebApp() : installRuntime();

Hmm... So this just puts you in a loop if you cancel out of the play store or if the install fails? How does that feel?
Attachment #8394937 - Flags: review?(wjohnston) → review+
Thanks for fixing this!

Please verify/require that it's actually a Firefox that's registered for webapps.
(The runtime implementation matters, e.g. Firefox can do SVG, which I need.)
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.