Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it work on (managed) iPads #1772

Open
zu opened this issue Sep 17, 2024 · 12 comments
Open

Make it work on (managed) iPads #1772

zu opened this issue Sep 17, 2024 · 12 comments

Comments

@zu
Copy link

zu commented Sep 17, 2024

Managed iPads (as we use them in prison, where restrictions apply, obviously) are an interesting scenario.
As a WordPress teacher and teacher in prison I want to teach participants how to create a website so they can prepare a website for the time after their imprisonment.

Managed iPads are ordinary iPads but are integrated with a device management system which allows to set restrictions, remote control certain features etc.
In our case and as a common scenario that means:

  • the device can only connect to a certain hotspot (in the classroom) and has no connection to the internet via any other means
  • acceptable websites are whitelisted (and need to be approved concerning usefulness, security etc. in a lengthy process)
  • the App store is deactivated, and Apps can only be installed via a self-service platform. To become listed here, apps need to be approved by the same or a similar approval process as websites
  • Sharing (e.g via AirDrop) is not possible from student to student but only via classroom management app through the teacher.

In my case that means:

  • it might become possible to get a selfhosted playground platform whitelisted, but I see no chance for this in the next few years.
  • it seems unrealistic to get a public playground platform whitelisted when installs and updates come from other "public" sites as the risk of smuggled-in code and/or information will hinder approval (even if the danger wouldn't be real)

In my understanding a realistic scenario could be a selfcontained app.
Not a pwa that needs to load external sources but an app that runs in a webview or safari on iPad.
To make it persisitent a zip file should contain everything or be able to get everything from within the app (even on another device) and there should be no need to load anything from outside the app.

I hope, I could describe the requirements comprehensible.
I also understand that it's a special case but I'm sure it would be a great step to "democratize publishing" that will be usable in other contexts as prison as well.

Let me know if you need further information.
Also, thanks to @adamziel for encouraging me to open this issue.

@adamziel
Copy link
Collaborator

Such an interesting use-case @zu! I would love to find a way to make it work. I have a few questions:

  1. How can you deliver a zip file (or any file) onto that device? You've mentioned Airdrop – I understand you can send a file over wifi from another device? Is there any other option, or is that it?
  2. Once a zip file is on the device, will you able to unzip it?
  3. If you can unzip it, would Safari be able to load it from a local directory?

My assumption is that the app would actually be an HTML file. @ellatrix explored a self-contained version of Playground loaded from a local HTML file with no service workers. Every resource was loaded via data URLs. The same approach could work here. Or were you thinking about another way of delivering an app?

@zu
Copy link
Author

zu commented Sep 17, 2024

Hi Adam

  1. There is an App called Classroom that is commonly used to distribute files to students. it's also possible to use a memory stick to deliver files.
  2. Yes, a zip can be unzipped
  3. I think, it's not possible to open a local file in Safari. I can open a html file in the file viewer, but this seems to not support local / relativ urls.

It might only be possible via an app (that needs to go through the approval process. :-( )
There is an app called worldwideweb that makes it possible to browse local files.

Anyway playground and blocknotes look very promising and it seems we're not far from a native WordPress app running on iPad. Looking forward to it and of course I'm ready to test and try out whatever comes my way.

Thank you so much for playground! Even when I'm not yet able to use it exactly how I dream, it's almost unbelievable that I'm even dreaming that far.

@adamziel
Copy link
Collaborator

adamziel commented Sep 25, 2024

Thank you for all those details @zu!

If you have the worldwideweb app installed, it might actually do exactly what we need. It seems to be starting a local web server – I can see http://braccio.local.:8080 on one of the screenshots. It also seems to have an embedded browser that can visit that server. Playground built with http://braccio.local.:8080 as its domain should just work.

You can check that by downloading the artifact from https://github.com/WordPress/wordpress-playground/actions/runs/11029849670, doing a manual search and replace from https://playground.wordpress.net to http://braccio.local.:8080, zipping it again, and shipping that to the device.

LMK what you find out!

we're not far from a native WordPress app running on iPad

That's my hope, too! Technically it's already possible to do that so we're one eager contributor away from having it :)

@zu
Copy link
Author

zu commented Sep 27, 2024

Thanks Adam, it sounds really promising. I'll let you know what I find out as soon as possible.
As I only will get access to a "normal" (not managed) iPad tonight, I wasn't yet able to test.

As for now, the worldwideweb app is not on the managed iPads but I'm optimistic that I'll get a generic WordPress app (or a "private/specific WordPress app" whitelisted and available for us.

@zu
Copy link
Author

zu commented Sep 28, 2024

Hi Adam, I'm not quiet getting it yet. You say "downloading the artifact" but I'm not sure how to do it.

Do I download the whole repo? I did, replaced "https://playground.wordpress.net" with the URL of the local server that pointed to the folder "dist > packages > playground > wasm-wordpress-net" but that didn't work.

The error was: ERR_TUNNEL_CONNECTION_FAILED (on Edge, in Chrome I get a blank, black page and an error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'addEventListener') in the console)

In Firefox I get a similar error than in Chrome.

This is on a MacBook Pro, not on an iPad yet.

I also tried on a (not managed iPad).

I defined "On my iPad > WP > wordpress-playground-trunk > packages > playground > website" as root for the "worldwideweb - mobile" App webserver.

It didn't show anything. Trying to opening the site in Safari (which is possible from within the "worldwideweb - mobile" App" led to an error message tha Safari couldn't connect to the server.

I think, i have the correct local path but since I can't see the source, I'm not sure, where the error could be :-(

@bgrgicak
Copy link
Collaborator

Hey @zu, I have some instructions that might help you. Please let me know if you have more questions.

Here is a link to the latest version of the Playground website.

A way to get to the latest version of Playground you can go the Deploy to playground.wordpress.net job.
You click on that latest successful run and at the bottom of the page there's an Artifacts section with a _playground-website _ download link.

Inside that zip you will have a dist > packages > playground > wasm-wordpress-net folder containing the website.

@zu
Copy link
Author

zu commented Sep 30, 2024

Thanks @bgrgicak for the help and clarification. That makes a lot of sense.

I can't test ist for the next few days as I don't have access to an iPad, but I'll let you know the results as soon as I have them.

I see some potential difficulties with http vs https but let's wait and see.

Thanks again for your kind support.

@zu
Copy link
Author

zu commented Oct 8, 2024

I was able to test it by now and it "almost worked" as you can see on the screenshots.

It never went further than "Preparing WordPress...".

Image

The Log didn't show anything:

Image

As it's not my iPad I can't buy the full version of the WorldWide Web app and can't use the secure context for now (which was used for this test).

Without the "secure context, I only get a black screen or in Safari a message that the connection to the server is not possible.

Image

Image

I should receive a test iPad shortly and will try further than.

@brandonpayton
Copy link
Member

Thanks for the update, @zu!

I should receive a test iPad shortly and will try further than.

That sounds good. We'll wait to hear from you.

@adamziel
Copy link
Collaborator

adamziel commented Oct 8, 2024

Note that localhost actually is a secure context. It's worrying that nothing came up in the logs tab. It seems like a 404 or another similar error that wouldn't be logged, CC @bgrgicak

@adamziel
Copy link
Collaborator

adamziel commented Oct 8, 2024

@zu if you were able to connect that iPad to mac, you might be able to get the full debug output from Safari devtools, see https://stackoverflow.com/questions/77768197/how-to-debug-safari-web-apps-on-mac

@zu
Copy link
Author

zu commented Oct 8, 2024

Thanks Adam for your quick answer. I was able to connect that iPad to my MacBook but couldn't get more information.
As I can't install the full version of the worldwideweb - mobile app and the demo time is over, I give up for now.

(I can't use the localhost secure context from the free version)

When I'll get my test iPad, I'll try again (with the full version of worldwideweb - mobile app)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Needs Author's Reply
Development

No branches or pull requests

4 participants