woocommerce / woocommerce-ios

WooCommerce iOS app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
312 stars 113 forks source link

Jetpack CP: add support for image upload and media library #5363

Closed jaclync closed 2 years ago

jaclync commented 3 years ago

Ref p91TBi-67H-p2

From https://github.com/woocommerce/woocommerce-android/issues/4879

Sites without Jetpack-the-plugin cannot use WPCom rest APIs, and since media upload currently uses a WPCom endpoint, we need to work on supporting an alternative endpoint.

After discussions with the Jetpack team (internal ref: p1632850990431500-slack-CBG1CP4EN), we agreed on using the endpoint: POST https://public-api.wordpress.com/wp/v2/sites/[YOUR_SITE]/media, there is a pending change to make it work with Jetpack CP sites, but we tested it in a private sandbox, and it works well, even with large files.

The above endpoint routes directly to the wp core endpoint, so we can support multipart upload for this case, by passing the file to upload in the param file.

peril-woocommerce[bot] commented 3 years ago
Fails
:no_entry_sign: Please add a feature label to this issue. e.g. 'feature: stats'

Generated by :no_entry_sign: dangerJS