2019-nCov icon indicating copy to clipboard operation
2019-nCov copied to clipboard

Android Sometimes Cannot Save Files

Open yjlou opened this issue 4 years ago • 6 comments

Platform: Android (either Chrome browser or the browser in Facebook App). Didn't test on iOS (iPhone/iPad) yet.

Way to reproduce: clicking 'Download' button in step 2

Expect behavior: downloading KML files.

Actual behavior: launching Google Maps Timeline instead. Sometimes a few files can be downloaded, but not all files.

Frequency: can be reproduced easily.

Analysis: I guess there exists race condition that while the Javascript is opening KML links to download, the Android App Link mechanism is also triggered in parallel. That's why some files got chances to download sometimes.

yjlou avatar Mar 02 '20 15:03 yjlou

Found something interesting:

<a href="intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end"> Take a QR code </a>

https://developer.chrome.com/multidevice/android/intents

Maybe we can set the package to google chrome?

Stimim avatar Mar 02 '20 15:03 Stimim

hmm, href="intent://www.google.com/maps/timeline/kml?authuser=0&pb=!1m8!1m3!1i2020!2i2!3i3!2m3!1i2020!2i2!3i3#Intent;scheme=https;package=com.android.chrome;end" seems working, but this only works on Android phone. I don't think iPhone support this :D On my phone, chrome browser was used directly, Android didn't ask me which App to use. Let me try to make the change.

Stimim avatar Mar 02 '20 16:03 Stimim

Can't make it work... opening one URL is fine, but can't open multiple urls, the browser would only download the first one. You can check the ToT of master branch.

Stimim avatar Mar 02 '20 17:03 Stimim

We can do this hack for Android only. Will try later today. Thanks.

yjlou avatar Mar 02 '20 17:03 yjlou

Did you implement this hack?

highoak avatar Mar 15 '20 05:03 highoak

We did, but that didn't work. Google Chrome on did open all the intent request in new tabs. However, only the first one got downloaded. Therefore we rollback to previous implementation.

Stimim avatar Mar 16 '20 02:03 Stimim