Skip to content

Conversation

@iamgabrielma
Copy link
Contributor

@iamgabrielma iamgabrielma commented Nov 26, 2025

Closes WOOMOB-1407

Description

As continuation from #16391 , this PR addresses the warnings coming from WPMediaPicker due to deprecated code from iOS17+. As before, we remove other bits that throw warnings but are unused in the WCiOS codebase (WPInputMediaPickerViewController). Why? Since these are no longer maintained as part of the WordPressAuthenticator library, are now part of the WCiOS codebase and represent a maintenance burden for us, so let's get rid of them if unused.

WPMediaPicker is used mainly when adding images to products, but also manages some of the low-level internals of the camera (types, orientation, ... ), used for example when we scan barcodes or QRs to add products to cart/orders

Changes:

  • For media types, we move from using raw strings to enum-case identifiers
  • Updates the trait registration pattern
  • Updates from video orientation to video rotation
  • Updates how we grab the view on the top of the stack

Test Steps

  • On a site with a product that can be scanned via barcode scanner/QR (if you have none, just go to Products > Open product details > Inventory > SKU and scan any barcode around you, then save changes)
  • Allow photo library access to the app if disabled
  • Go to Products > Create or update an existing product > Add a product image > select WordPress Media Library. Should work as expected.
  • Products > Create or update an existing product > Add a product image > select Take a photo. Should work as expected.
  • Unlock orientation lock in device if enabled
  • Go to Orders > create new by tapping the QR code at the top left corner. Change orientations and observe that the camera works as expected. Scan the barcode or QR and see how behaves normally. Note that orientation changes only work when we present the scanner, not when we push it into the stack (like in products), this is expected and existing functionality.
ScreenRecording_12-03-2025.scanner.480p.mov

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 26, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Numberpr16407-7e5a18c
Version23.7
Bundle IDcom.automattic.alpha.woocommerce
Commit7e5a18c
Installation URL180up4t9gcm20
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

…rectly

previous approach seems to get all windows, find the last one, then get its window scene, but we can use `UISceneActivationStateForegroundActive` to find this directly
@iamgabrielma
Copy link
Contributor Author

Testing this issue is currently blocked by WOOMOB-1812. Leaving as draft temporarily

@iamgabrielma iamgabrielma added this to the 23.9 milestone Nov 28, 2025
@iamgabrielma iamgabrielma added type: task An internally driven task. type: technical debt Represents or solves tech debt of the project. labels Dec 3, 2025
@iamgabrielma iamgabrielma marked this pull request as ready for review December 3, 2025 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: task An internally driven task. type: technical debt Represents or solves tech debt of the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants