vaporBoy icon indicating copy to clipboard operation
vaporBoy copied to clipboard

Opening ROMs via the iOS Files app / file picker doesn't work

Open ahydronous opened this issue 4 years ago โ€ข 4 comments

Trying to open a ROM via the file picker always leaves them greyed out, whether it's .zip or .gbc and regardless if it's stored locally or on iCloud or Dropbox.

I'm on iOS 14.3

ahydronous avatar Jan 12 '21 05:01 ahydronous

Hmmm that's odd! Thanks for the bug report! I'll look into this once I get the chance! :smile:

torch2424 avatar Jan 14 '21 18:01 torch2424

The same thing happens on iOS 15 :(

lxgr avatar Sep 24 '21 08:09 lxgr

Does not work for me either. The fix is simple. In ROMSourceSelector.js

Last lines currently is:

return (
      <div class="ROMSourceSelector">
        {/*Our Hidden Input for uploading files*/}
        <input
          type="file"
          id="ROMFileInput"
          class="hidden"
          accept=".gb, .gbc, .zip"
          value={undefined}
          onChange={event => {
            this.loadLocalFile(event);
          }}
        />
        {sourceOptions}
      </div>
    );

As iOS and PWA's never really work as expected you can't specify the types: https://caniuse.com/input-file-accept

The code should be:

return (
      <div class="ROMSourceSelector">
        {/*Our Hidden Input for uploading files*/}
        <input
          type="file"
          id="ROMFileInput"
          class="hidden"
          accept="*"
          value={undefined}
          onChange={event => {
            this.loadLocalFile(event);
          }}
        />
        {sourceOptions}
      </div>
    );

I've tested this on my iPhone 13 and it works. Would be nice to have updated @torch2424 I know this allows all files to be uploaded. One could add a filter afterwards to check if the selected file actually is the right file types?

nuller1joe avatar Mar 23 '22 17:03 nuller1joe

@torch2424 Any chance of you quickly committing this fix? It would mean VaporBoy actually works with iOS, allowing us to play our old games without a jailbreak! โค๏ธ

ahydronous avatar Jun 22 '22 18:06 ahydronous

My bad about the late review on this y'all! ๐Ÿ˜… I shifted my main focus to my music career, rather than development, so I haven't been checking Github at all. But! I went ahead and tested the deploy preview, and this all works on my end. So merging! ๐Ÿ˜„ ๐ŸŽ‰

Thank you VERY much @nuller1joe for the PR! I super super appreciate it! ๐Ÿ™๐Ÿพ ๐ŸŽ‰

cc @ahydronous & @lxgr

torch2424 avatar Oct 12 '22 22:10 torch2424