Closed JorgeMucientes closed 4 weeks ago
Thanks for reporting! š
I don't think we need to fetch the media from WP media library when we already have the URL for the resource. Passing the URL for the resource should be enough for creating the Blaze campaign.
@JorgeMucientes we fetch the media because the API expects also the mimeType
of the media, fetching the media returns a MediaModel
which has all the needed information.
I think we can quickly fix this on the FluxC
part by implementing a way to fetch the media using Jetpack CP, I think it's not there just because we didn't need it in the past, it would be a change like this: https://github.com/wordpress-mobile/WordPress-FluxC-Android/pull/2193
Oh, thanks for sharing the quick context @hichamboushaba. Yeah using /wp/v2 endpoint for fetching media
should fix the problem. Cool that we already have a PR for reference šš¼.
I think we can tackle this task as part of the next Blaze i4
Blaze standalone plugin has been released. With it, we now don't need a full Jetpack connection to create campaigns. In Android 2 changes are needed to support this:
Update isBlazeEnabled use case logic
Enable Blaze for Jetpack CP connection when Blaze plugin is installed. Currently the logic to determine if Blaze is enabled for a given site is the following:
We need to update the condition
selectedSite.connectionType == SiteConnectionType.Jetpack
to:Update media picker logic
When Blaze plugin is used, a Jetpack CP connection is established. This connection results in attempting to fetch media from WordPress media lib using
mMediaXmlrpcClient.fetchMedia
MediaStore.Kt
And for some reason this code is resulting in the following error:
I'm not sure why this error happens but I don't think we need to fetch the media from WP media library when we already have the URL for the resource. Passing the URL for the resource should be enough for creating the Blaze campaign.