Add multi-site support to Android demo app#155
Conversation
…ing enabled Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
android/app/src/main/java/com/example/gutenbergkit/EditorActivity.kt
Dismissed
Show dismissed
Hide dismissed
dcalhoun
left a comment
There was a problem hiding this comment.
Thank you! The test plan succeeds for me. I successfully loaded both the bundled and remote editors.
I left a few comments for your consideration, but they are not blocking.
| .setPlugins(true) // Enable plugins for remote editor | ||
| .setSiteURL(config.siteUrl) | ||
| .setSiteApiRoot(config.siteApiRoot) | ||
| .setSiteApiNamespace(arrayOf("wp/v2")) |
There was a problem hiding this comment.
Setting a namespace is applicable for WPCOM sites communicating through the WPCOM API. We do not need to set a namespace for the default wp/v2.
| .setSiteApiNamespace(arrayOf("wp/v2")) | |
| .setSiteApiNamespace(arrayOf()) |
| defaultConfig { | ||
| applicationId = "com.example.gutenbergkit" | ||
| minSdk = 22 | ||
| minSdk = 24 |
There was a problem hiding this comment.
It seems that bumping to 24 broke loading the development server from an IP address on the development machine, that it may include tighter default security.
It seems that one now has to add an explicit entry for the IP in the network security configuration. Is there a better way to allow the development server to load?
There was a problem hiding this comment.
This is not something I am familiar with :( I've made this bump because wordpress-rs requires it, although I don't remember why.
Unless this is a major issue for you, I think it's fine to go with a temporary solution like the one you mentioned above. If it's major, I can look into it.
There was a problem hiding this comment.
While annoying, it's not a blocker for my workflow; I can work around it.
The bigger concern is someone less familiar with the project encountering failed development server loads without knowledge of this workaround. Also, we don't want to commit one-off IP addresses to this configuration file. I'll try to find a solution soon.
There was a problem hiding this comment.
OK, please let me know before spending any significant time on this. I'll double check that we need minSdk = 24 for wordpress-rs.
If you want, we can remove wordpress-rs, but I find having a proper authentication flow easier to work with than always having to figure out the authentication token, updating a config document etc. Having said that, I don't plan to work in this repo too much, so whatever works best for you is fine with me.

Similar to the iOS demo app, allows users to add and manage multiple WordPress sites alongside the bundled editor.
Changes
Testing Instructions
Requirements: WordPress sites must have the Application Passwords feature enabled (WordPress 5.6+ or Jetpack plugin).