microsoft / pxt-microbit

A Blocks / JavaScript code editor for the micro:bit built on Microsoft MakeCode
https://makecode.microbit.org
Other
721 stars 592 forks source link

MakeCode on iOS Safari no longer sends files to the iOS app #2601

Closed martinwork closed 1 year ago

martinwork commented 4 years ago

Describe the bug

Testing MakeCode in Safari on iPad, files were not routed to the iOS app, but saved in a Downloads folder in my iCloud drive. They seem to be typed as TXT, so they won't load back into MakeCode. Download opens a dialogue about connecting with a USB cable.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'https://makecode.microbit.org/'
  2. Tap on 'New project'
  3. Tap on "Download"
  4. See error

Expected behavior The file should be transferred to the iOS app.

Desktop (please complete the following information):

martinwork commented 4 years ago

Everything seems to work still on iOS 9.

The app is listed as a choice when I airdrop a hex file, so I guess it's file association is working.

Has something changed in iOS 13 that has broken the browser recognition?

martinwork commented 4 years ago

It's a problem with the browser detection based on the user agent which defaults to

Safari: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15

but can be changed by the option at Settings/Safari/Request Desktop Website/All websites to

Mozilla/5.0 (iPad; CPU OS 13_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Mobile/15E148 Safari/604.1

So the current test for iPad needs to have this case added: https://github.com/microsoft/pxt/blob/edfee811f62773c57115ca404a0a89f9d3b4e107/webapp/src/monaco.tsx#L661

abchatra commented 4 years ago

@martinwork download worked as expected in my iPhone app. Is this only in iPad?

martinwork commented 4 years ago

This issue affects iOS 13 Safari on iPad.

It depends on Settings/Safari/Request Desktop Website/All websites as described above. The setting is available for individual websites on the aA menu and configurable inside aA/Website Settings. So a workaround is to set this to mobile. The default on iPad became Desktop with iOS 13.

https://www.computerworld.com/article/3441222/13-ios-13ipados-features-you-might-not-know-about.html.

Saving files might be a useful option (e.g if USB transfer were possible), but the files should be .hex not .hex.txt.

martinwork commented 4 years ago

@abchatra Do you need any more information? This is still happening in beta.

jaustin commented 1 year ago

@abchatra this issue seems to either have recurred or not been fully fixed.

On iPad: By default when loading things from microbit.org or the MakeCode docs, etc, it's now very hard to get them into the iOS app to flash them to the micro:bit.

If you select 'Mobile site' then the rest of the UI looks the same but you get the excellent option to open the hex in the iOS app when you choose 'download'

I think this should be the primary behaviour on iOS and iPadOS

abchatra commented 1 year ago

@jaustin I would open a new bug with repro steps. This is 3-year-old issue and probably not the same. Please provide device details and other stuff for the new issue.